MCPcopy Create free account
hub / github.com/dmlc/decord / test_bytes_io

Function test_bytes_io

tests/python/unittests/test_av_reader.py:15–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13 assert len(av) == 328
14
15def test_bytes_io():
16 fn = os.path.join(os.path.dirname(__file__), '..', '..', 'cpp', 'audio', 'count_down.mov')
17 with open(fn, 'rb') as f:
18 av = AVReader(f)
19 assert len(av) == 328
20 av2 = get_normal_av_reader()
21 audio, video = av[10]
22 audio2, video2 = av2[10]
23 assert np.allclose(audio.asnumpy(), audio2.asnumpy())
24 assert np.allclose(video.asnumpy(), video2.asnumpy())
25
26def test_no_audio_stream():
27 from nose.tools import assert_raises

Callers

nothing calls this directly

Calls 3

AVReaderClass · 0.90
get_normal_av_readerFunction · 0.85
asnumpyMethod · 0.80

Tested by

no test coverage detected