@@ -57,7 +57,9 @@ def setUp(self):
57
57
cleanpath (os .path .dirname (DUMMY_FILE_WRITECHUNK ), self )
58
58
59
59
def test_return_false_on_invalid_data (self ):
60
- did_succeed = fileio .write_chunk (self .tmp_path , 1234 , 0 , self .logger )
60
+ # NOTE: we make sure to disable any forced stringification here
61
+ did_succeed = fileio .write_chunk (self .tmp_path , 1234 , 0 , self .logger ,
62
+ force_string = False )
61
63
self .assertFalse (did_succeed )
62
64
63
65
def test_return_false_on_invalid_offset (self ):
@@ -99,28 +101,28 @@ def test_store_bytes_at_offset(self):
99
101
100
102
@unittest .skip ("TODO: enable again - requires the temporarily disabled auto mode select" )
101
103
def test_store_bytes_in_text_mode (self ):
102
- fileio .write_chunk (self .tmp_path , DUMMY_BYTES , 0 , self .logger ,
103
- mode = "r+" )
104
+ fileio .write_chunk (self .tmp_path , DUMMY_BYTES , 0 , self .logger ,
105
+ mode = "r+" )
104
106
105
- with open (self .tmp_path , 'rb' ) as file :
106
- content = file .read (1024 )
107
- self .assertEqual (len (content ), DUMMY_BYTES_LENGTH )
108
- self .assertEqual (content [:], DUMMY_BYTES )
107
+ with open (self .tmp_path , 'rb' ) as file :
108
+ content = file .read (1024 )
109
+ self .assertEqual (len (content ), DUMMY_BYTES_LENGTH )
110
+ self .assertEqual (content [:], DUMMY_BYTES )
109
111
110
112
@unittest .skip ("TODO: enable again - requires the temporarily disabled auto mode select" )
111
113
def test_store_unicode (self ):
112
- fileio .write_chunk (self .tmp_path , DUMMY_UNICODE , 0 , self .logger ,
113
- mode = 'r+' )
114
+ fileio .write_chunk (self .tmp_path , DUMMY_UNICODE , 0 , self .logger ,
115
+ mode = 'r+' )
114
116
115
- with open (self .tmp_path , 'r' ) as file :
116
- content = file .read (1024 )
117
- self .assertEqual (len (content ), DUMMY_UNICODE_LENGTH )
118
- self .assertEqual (content [:], DUMMY_UNICODE )
117
+ with open (self .tmp_path , 'r' ) as file :
118
+ content = file .read (1024 )
119
+ self .assertEqual (len (content ), DUMMY_UNICODE_LENGTH )
120
+ self .assertEqual (content [:], DUMMY_UNICODE )
119
121
120
122
@unittest .skip ("TODO: enable again - requires the temporarily disabled auto mode select" )
121
123
def test_store_unicode_in_binary_mode (self ):
122
- fileio .write_chunk (self .tmp_path , DUMMY_UNICODE , 0 , self .logger ,
123
- mode = 'r+b' )
124
+ fileio .write_chunk (self .tmp_path , DUMMY_UNICODE , 0 , self .logger ,
125
+ mode = 'r+b' )
124
126
125
127
with open (self .tmp_path , 'r' ) as file :
126
128
content = file .read (1024 )
@@ -135,7 +137,9 @@ def setUp(self):
135
137
cleanpath (os .path .dirname (DUMMY_FILE_WRITEFILE ), self )
136
138
137
139
def test_return_false_on_invalid_data (self ):
138
- did_succeed = fileio .write_file (1234 , self .tmp_path , self .logger )
140
+ # NOTE: we make sure to disable any forced stringification here
141
+ did_succeed = fileio .write_file (1234 , self .tmp_path , self .logger ,
142
+ force_string = False )
139
143
self .assertFalse (did_succeed )
140
144
141
145
def test_return_false_on_invalid_dir (self ):
0 commit comments