Python: Fix VFS test

This commit is contained in:
Vicki Pfau 2017-10-14 19:07:28 -07:00
parent e820e4dcbb
commit f69b652e27
1 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ def test_vfs_read():
vf = vfs.openPath(__file__) vf = vfs.openPath(__file__)
buffer = ffi.new('char[13]') buffer = ffi.new('char[13]')
assert vf.read(buffer, 13) == 13 assert vf.read(buffer, 13) == 13
assert ffi.string(buffer) == 'import pytest' assert ffi.string(buffer) == b'import pytest'
vf.close() vf.close()
def test_vfs_readline(): def test_vfs_readline():
@ -28,9 +28,9 @@ def test_vfs_readline():
linelen = vf.readline(buffer, 16) linelen = vf.readline(buffer, 16)
assert linelen in (14, 15) assert linelen in (14, 15)
if linelen == 14: if linelen == 14:
assert ffi.string(buffer) == 'import pytest\n' assert ffi.string(buffer) == b'import pytest\n'
elif linelen == 15: elif linelen == 15:
assert ffi.string(buffer) == 'import pytest\r\n' assert ffi.string(buffer) == b'import pytest\r\n'
vf.close() vf.close()
def test_vfs_readAllSize(): def test_vfs_readAllSize():