@@ -285,8 +285,8 @@ def _mock_popens(
285
285
mock_extract ,
286
286
mock_subprocess ,
287
287
compare_status = 0 ,
288
- compare_stdout = "" ,
289
- compare_stderr = "" ,
288
+ compare_stdout = b "" ,
289
+ compare_stderr = b "" ,
290
290
convert_status = 0 ,
291
291
):
292
292
mock_extract .return_value = b"extracted_path"
@@ -298,33 +298,33 @@ def _mock_popens(
298
298
]
299
299
300
300
def test_compare_success_similar (self , mock_extract , mock_subprocess ):
301
- self ._mock_popens (mock_extract , mock_subprocess , 0 , "10" , "err" )
301
+ self ._mock_popens (mock_extract , mock_subprocess , 0 , b "10" , b "err" )
302
302
assert self ._similarity (20 )
303
303
304
304
def test_compare_success_different (self , mock_extract , mock_subprocess ):
305
- self ._mock_popens (mock_extract , mock_subprocess , 0 , "10" , "err" )
305
+ self ._mock_popens (mock_extract , mock_subprocess , 0 , b "10" , b "err" )
306
306
assert not self ._similarity (5 )
307
307
308
308
def test_compare_status1_similar (self , mock_extract , mock_subprocess ):
309
- self ._mock_popens (mock_extract , mock_subprocess , 1 , "out" , "10" )
309
+ self ._mock_popens (mock_extract , mock_subprocess , 1 , b "out" , b "10" )
310
310
assert self ._similarity (20 )
311
311
312
312
def test_compare_status1_different (self , mock_extract , mock_subprocess ):
313
- self ._mock_popens (mock_extract , mock_subprocess , 1 , "out" , "10" )
313
+ self ._mock_popens (mock_extract , mock_subprocess , 1 , b "out" , b "10" )
314
314
assert not self ._similarity (5 )
315
315
316
316
def test_compare_failed (self , mock_extract , mock_subprocess ):
317
- self ._mock_popens (mock_extract , mock_subprocess , 2 , "out" , "10" )
317
+ self ._mock_popens (mock_extract , mock_subprocess , 2 , b "out" , b "10" )
318
318
assert self ._similarity (20 ) is None
319
319
320
320
def test_compare_parsing_error (self , mock_extract , mock_subprocess ):
321
- self ._mock_popens (mock_extract , mock_subprocess , 0 , "foo" , "bar" )
321
+ self ._mock_popens (mock_extract , mock_subprocess , 0 , b "foo" , b "bar" )
322
322
assert self ._similarity (20 ) is None
323
323
324
324
def test_compare_parsing_error_and_failure (
325
325
self , mock_extract , mock_subprocess
326
326
):
327
- self ._mock_popens (mock_extract , mock_subprocess , 1 , "foo" , "bar" )
327
+ self ._mock_popens (mock_extract , mock_subprocess , 1 , b "foo" , b "bar" )
328
328
assert self ._similarity (20 ) is None
329
329
330
330
def test_convert_failure (self , mock_extract , mock_subprocess ):
0 commit comments