1
0
mirror of synced 2025-01-19 16:18:39 +01:00

Fix unit tests

This commit is contained in:
Stepland 2020-07-25 14:46:26 +02:00
parent e20884ff25
commit 9801260157

View File

@ -18,11 +18,11 @@ from . import (
def dump_and_load(expected_song, dump_function, load_function):
files = dump_function(expected_song)
assert len(files) == 1
filename, str_io = list(files.items())[0]
with tempfile.NamedTemporaryFile(mode="w+") as file:
file.write(str_io.getvalue())
with tempfile.NamedTemporaryFile(mode="wb") as file:
files = dump_function(expected_song, Path(file.name))
assert len(files) == 1
filename, contents = list(files.items())[0]
file.write(contents)
file.seek(0)
actual_song = load_function(file.name)