fixes tests

This commit is contained in:
Fabien LOISON 2017-12-22 16:21:38 +01:00
parent 247b17b7a5
commit 3e84dfbb7d
No known key found for this signature in database
GPG Key ID: FF90CA148348048E
2 changed files with 5 additions and 3 deletions

BIN
test/images/image.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -43,9 +43,11 @@ class Test_optimize(object):
assert output.read().startswith(_MAGIC_PNG)
# file
output = tmpdir.join("output2.png")
output_path = os.path.join(str(tmpdir), "output2.png")
output = open(output_path, "wb")
yoga.image.optimize("test/images/alpha.png", output)
output.seek(0)
output.close()
output = open(output_path, "rb")
assert output.read().startswith(_MAGIC_PNG)
# ByteIO
@ -87,7 +89,7 @@ class Test_optimize(object):
# Other
output = io.BytesIO()
with pytest.raises(ValueError):
yoga.image.optimize("test/images/unused-alpha.svg", output, {
yoga.image.optimize("test/images/image.gif", output, {
"output_format": "orig"
})