tests: read zip file in binary mode (#38781)

This commit is contained in:
Emmanuel Cazenave 2020-01-13 16:20:35 +01:00
parent 4138a92412
commit 064e8fd187
1 changed files with 2 additions and 2 deletions

View File

@ -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>'