diff options
author | jaseg <git@jaseg.de> | 2024-01-22 11:52:42 +0100 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2024-01-22 11:53:02 +0100 |
commit | 4e76f01ecc4c55a8dfd923a44bebd671907f944b (patch) | |
tree | 00873b2d1e747d25f0668f5c27eb386a2020b1dc /tests | |
parent | 141ec7d372c8d536c208c39bb89132d69aa1b36c (diff) | |
download | python-mpv-4e76f01ecc4c55a8dfd923a44bebd671907f944b.tar.gz python-mpv-4e76f01ecc4c55a8dfd923a44bebd671907f944b.tar.bz2 python-mpv-4e76f01ecc4c55a8dfd923a44bebd671907f944b.zip |
mpv.py: Add play_bytes convenience function
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test_mpv.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_mpv.py b/tests/test_mpv.py index 9cc688d..0935a32 100755 --- a/tests/test_mpv.py +++ b/tests/test_mpv.py @@ -664,6 +664,24 @@ class TestStreams(unittest.TestCase): m.terminate() disp.stop() + def test_play_bytes(self): + handler = mock.Mock() + + disp = Display() + disp.start() + m = mpv.MPV(vo=testvo) + def cb(evt): + handler(evt.as_dict(decoder=mpv.lazy_decoder)) + m.register_event_callback(cb) + + with open(TESTVID, 'rb') as f: + m.play_bytes(f.read()) + + m.wait_for_playback() + handler.assert_any_call({'event': 'end-file', 'reason': 'eof', 'playlist_entry_id': 1}) + m.terminate() + disp.stop() + class TestLifecycle(unittest.TestCase): def test_create_destroy(self): |