diff options
author | jaseg <code@jaseg.net> | 2017-08-06 21:32:17 +0200 |
---|---|---|
committer | jaseg <code@jaseg.net> | 2017-08-06 21:32:17 +0200 |
commit | cc84e4939b56b6213225a69e422bfea9bccdd252 (patch) | |
tree | 923d04a366fd1ebe25c19b4b279ed0f70ce2d2e8 /mpv-test.py | |
parent | 96e8ca390ae9523f44e51c4fd48fe98fa5f3d187 (diff) | |
download | python-mpv-cc84e4939b56b6213225a69e422bfea9bccdd252.tar.gz python-mpv-cc84e4939b56b6213225a69e422bfea9bccdd252.tar.bz2 python-mpv-cc84e4939b56b6213225a69e422bfea9bccdd252.zip |
Re-nerf property observer tests
Diffstat (limited to 'mpv-test.py')
-rwxr-xr-x | mpv-test.py | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/mpv-test.py b/mpv-test.py index 106c772..1299708 100755 --- a/mpv-test.py +++ b/mpv-test.py @@ -223,25 +223,23 @@ class ObservePropertyTest(MpvTestCase): any_order=True) handler.reset_mock() - # FIXME the upstream observer API is extremely unreliable ATM. - - #m.mute = True - #m.loop = 'inf' - #self.assertEqual(m.mute, True) - #self.assertEqual(m.loop, 'inf') - - #time.sleep(0.5) - #foo.unobserve_mpv_properties() - - #m.mute = False - #m.loop = False - #m.mute = True - #m.loop = 'inf' - #m.terminate() # needed for synchronization of event thread - #handler.assert_has_calls([ - # mock.call('mute', True), - # mock.call('loop', 'inf')], - # any_order=True) + m.mute = True + m.loop = 'inf' + self.assertEqual(m.mute, True) + self.assertEqual(m.loop, 'inf') + + time.sleep(0.05) + foo.unobserve_mpv_properties() + + m.mute = False + m.loop = False + m.mute = True + m.loop = 'inf' + m.terminate() # needed for synchronization of event thread + handler.assert_has_calls([ + mock.call('mute', True), + mock.call('loop', 'inf')], + any_order=True) class TestLifecycle(unittest.TestCase): def test_create_destroy(self): @@ -349,8 +347,7 @@ class RegressionTests(MpvTestCase): m.loop = False m.loop = 'inf' m.terminate() # needed for synchronization of event thread - # FIXME the upstream observer API is extremely unreliable ATM. - #handler.assert_has_calls([mock.call('loop', False), mock.call('loop', 'inf')]) + handler.assert_has_calls([mock.call('loop', False), mock.call('loop', 'inf')]) if __name__ == '__main__': |