Commit eea08baa authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Generated unicode file for testing

parent f1e4dfc0
Pipeline #12298 passed with stages
in 11 minutes and 50 seconds
test.mov
\ No newline at end of file
......@@ -88,8 +88,25 @@ def test_video_reader_attributes():
nose.tools.eq_(len(iv.video_type[2]), len(iv.frame_type[2])+1)
assert isinstance(iv.info, str)
def write_unicode_temp_file():
# Writing temp file for testing
from . import writer
width = 20
height = 20
framerate = 24
outv = writer(UNICODE_VIDEO, height, width, framerate)
for i in range(0, 3):
newframe = (numpy.random.random_integers(0,255,(3,height,width)))
outv.append(newframe.astype('uint8'))
outv.close()
def test_video_reader_unicode():
# Writing temp file for testing
write_unicode_temp_file()
from . import reader
iv = reader(UNICODE_VIDEO)
......@@ -98,6 +115,8 @@ def test_video_reader_unicode():
assert 'ß' in UNICODE_VIDEO
assert 'ß' in iv.filename
os.unlink(UNICODE_VIDEO)
def test_video_reader_str():
from . import reader
......@@ -133,14 +152,19 @@ def test_iteration():
def test_base_load_on_unicode():
# Writing temp file for testing
write_unicode_temp_file()
from . import reader
f = reader(UNICODE_VIDEO)
objs = load(UNICODE_VIDEO)
nose.tools.eq_(len(f), len(objs))
for l, i in zip(objs, f):
assert numpy.allclose(l, i)
assert numpy.allclose(l.shape, i.shape)
os.unlink(UNICODE_VIDEO)
def test_indexing():
from . import reader
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment