Fix new test under python < 3.6

This commit is contained in:
Marcin Kulik
2018-03-04 10:42:58 +01:00
parent 58cf009314
commit 7fa2cdc62f

View File

@@ -1,6 +1,7 @@
from ..test_helper import Test
import asciinema.asciicast.v2 as v2
import tempfile
import json
class TestWriter(Test):
@@ -15,9 +16,9 @@ class TestWriter(Test):
w.write_stdout(4, bytes.fromhex('78 78'))
with open(path, 'r') as f:
text = f.read()
assert text == '{"version": 2, "width": 80, "height": 24}\n' + \
'[1, "o", "x"]\n' + \
'[2, "o", "xżó"]\n' + \
'[3, "o", "łć"]\n' + \
'[4, "o", "xx"]\n', 'got:\n\n%s' % text
lines = list(map(json.loads, f.read().strip().split('\n')))
assert lines == [{"version": 2, "width": 80, "height": 24},
[1, "o", "x"],
[2, "o", "xżó"],
[3, "o", "łć"],
[4, "o", "xx"]], 'got:\n\n%s' % lines