tests: read zip file in binary mode (#38781)
This commit is contained in:
parent
4138a92412
commit
064e8fd187
|
@ -112,7 +112,7 @@ def test_no_parts(tpl_builder, dest):
|
|||
z.render_to_path(dest)
|
||||
|
||||
full_path = dest / 'coucou-10.zip'
|
||||
with full_path.open() as fd:
|
||||
with full_path.open('rb') as fd:
|
||||
with zipfile.ZipFile(fd) as zi:
|
||||
assert zi.namelist() == []
|
||||
|
||||
|
@ -131,7 +131,7 @@ def test_with_parts(tpl_builder, dest):
|
|||
str(part)
|
||||
|
||||
full_path = dest / 'coucou-10.zip'
|
||||
with full_path.open() as fd:
|
||||
with full_path.open('rb') as fd:
|
||||
with zipfile.ZipFile(fd) as zi:
|
||||
assert zi.namelist() == ['coucou-10-part1.xml', 'coucou-10-dôc.xml']
|
||||
assert zi.open('coucou-10-part1.xml').read().decode('utf-8') == '<?xml version="1.0"?><body>blabla</body>'
|
||||
|
|
Loading…
Reference in New Issue