summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <code@jaseg.net>2020-07-15 21:27:59 +0200
committerjaseg <code@jaseg.net>2020-07-15 22:03:37 +0200
commitf5a9690739a8c81a19602b3b151d74dec0cbbcf5 (patch)
tree4a5d55ea235f9e0e2246c40cc6754647321e33d7
parentb54d5f55210b720266704dc4437c3598cc58680f (diff)
downloadpython-mpv-f5a9690739a8c81a19602b3b151d74dec0cbbcf5.tar.gz
python-mpv-f5a9690739a8c81a19602b3b151d74dec0cbbcf5.tar.bz2
python-mpv-f5a9690739a8c81a19602b3b151d74dec0cbbcf5.zip
tests: Fix test_property_observer_decorator (#108)
-rwxr-xr-xmpv-test.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/mpv-test.py b/mpv-test.py
index 5123dc3..7d97768 100755
--- a/mpv-test.py
+++ b/mpv-test.py
@@ -259,18 +259,18 @@ class ObservePropertyTest(MpvTestCase):
m = self.m
m.play(TESTVID)
- m.loop = 'inf'
+ m.slang = 'ru'
m.mute = True
@m.property_observer('mute')
- @m.property_observer('loop')
+ @m.property_observer('slang')
def foo(*args, **kwargs):
handler(*args, **kwargs)
m.mute = False
- m.loop = False
+ m.slang = 'jp'
self.assertEqual(m.mute, False)
- self.assertEqual(m.loop, False)
+ self.assertEqual(m.slang, ['jp'])
# Wait for tick. AFAICT property events are only generated at regular
# intervals, and if we change a property too fast we don't get any
@@ -281,26 +281,26 @@ class ObservePropertyTest(MpvTestCase):
# which these properties were previously accessed. Thus, any_order.
handler.assert_has_calls([
mock.call('mute', False),
- mock.call('loop', False)],
+ mock.call('slang', ['jp'])],
any_order=True)
handler.reset_mock()
m.mute = True
- m.loop = 'inf'
+ m.slang = 'ru'
self.assertEqual(m.mute, True)
- self.assertEqual(m.loop, True)
+ self.assertEqual(m.slang, ['ru'])
time.sleep(0.05)
foo.unobserve_mpv_properties()
m.mute = False
- m.loop = False
+ m.slang = 'jp'
m.mute = True
- m.loop = 'inf'
+ m.slang = 'ru'
m.terminate() # needed for synchronization of event thread
handler.assert_has_calls([
mock.call('mute', True),
- mock.call('loop', True)],
+ mock.call('slang', ['ru'])],
any_order=True)
class KeyBindingTest(MpvTestCase):