diff options
author | jaseg <code@jaseg.net> | 2016-08-17 23:21:19 +0200 |
---|---|---|
committer | jaseg <code@jaseg.net> | 2016-08-17 23:21:19 +0200 |
commit | ab8b8b54772d06416abf3ae36724b5272cddd59d (patch) | |
tree | 72654ad5a469d65243f25976aefc186c38879b8d /mpv-test.py | |
parent | de7b6711035a187492f9753fc8808d9c2ad1dd55 (diff) | |
download | python-mpv-ab8b8b54772d06416abf3ae36724b5272cddd59d.tar.gz python-mpv-ab8b8b54772d06416abf3ae36724b5272cddd59d.tar.bz2 python-mpv-ab8b8b54772d06416abf3ae36724b5272cddd59d.zip |
Improve event handling, add message handling, add key binding foo
Diffstat (limited to 'mpv-test.py')
-rwxr-xr-x | mpv-test.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mpv-test.py b/mpv-test.py index 2be2735..e5a51f2 100755 --- a/mpv-test.py +++ b/mpv-test.py @@ -175,17 +175,20 @@ class TestLifecycle(unittest.TestCase): def test_event_callback(self): handler = mock.Mock() m = mpv.MPV('no-video') - m.event_callbacks.append(handler) + m.register_event_callback(handler) m.play(TESTVID) m.wait_for_playback() - del m + + m.unregister_event_callback(handler) handler.assert_has_calls([ mock.call({'reply_userdata': 0, 'error': 0, 'event_id': 6, 'event': None}), mock.call({'reply_userdata': 0, 'error': 0, 'event_id': 9, 'event': None}), mock.call({'reply_userdata': 0, 'error': 0, 'event_id': 7, 'event': {'reason': 4}}), - mock.call({'reply_userdata': 0, 'error': 0, 'event_id': 11, 'event': None}), - mock.call({'reply_userdata': 0, 'error': 0, 'event_id': 1, 'event': None}) ], any_order=True) + handler.reset_mock() + + del m + handler.assert_not_called() def test_log_handler(self): handler = mock.Mock() |