summaryrefslogtreecommitdiff
path: root/mpv-test.py
diff options
context:
space:
mode:
authorjaseg <code@jaseg.net>2016-08-13 01:30:03 +0200
committerjaseg <code@jaseg.net>2016-08-13 01:30:03 +0200
commit97d929e27f93d329eecb5428542c6423683004cc (patch)
treeba3e592544b2ee75481f623915c94a2b5a46535c /mpv-test.py
parenta8be9bd5343a43a10ad64e78e9f75516c173dba2 (diff)
downloadpython-mpv-97d929e27f93d329eecb5428542c6423683004cc.tar.gz
python-mpv-97d929e27f93d329eecb5428542c6423683004cc.tar.bz2
python-mpv-97d929e27f93d329eecb5428542c6423683004cc.zip
Add loads of new properties
Diffstat (limited to 'mpv-test.py')
-rwxr-xr-xmpv-test.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/mpv-test.py b/mpv-test.py
index 4fd18bd..72ba3eb 100755
--- a/mpv-test.py
+++ b/mpv-test.py
@@ -34,7 +34,24 @@ class TestProperties(unittest.TestCase):
for name, (ptype, access) in mpv.ALL_PROPERTIES.items():
self.assertTrue('r' in access or 'w' in access)
self.assertRegex(name, '^[-0-9a-z]+$')
- self.assertIn(ptype, (int, float, str, mpv.ynbool))
+ self.assertIn(ptype, (int, float, str, mpv.ynbool, mpv.commalist))
+
+ def test_completeness(self):
+ ledir = dir(self.m)
+ for prop in self.m.property_list:
+ if prop in ('stream-path', 'demuxer', 'mixer-active'):
+ continue # Property is deemed useless by man mpv(1)
+ if prop in ('osd-sym-cc', 'osd-ass-cc', 'working-directory'):
+ continue # Property is deemed useless by me
+ if prop in ('clock', 'keepaspect',
+ 'tv-scan', 'tv-channel', 'tv-norm', 'tv-freq',
+ 'ff-vid', 'ff-aid', 'ff-sid',
+ 'colormatrix-gamma'):
+ continue # Property is undocumented in man mpv(1) and we don't want to risk it
+ if prop in ('hwdec-active', 'hwdec-detected'):
+ continue # Property is deprecated
+ prop = prop.replace('-', '_')
+ self.assertTrue(prop in ledir, 'Property {} not found'.format(prop))
def test_read(self):
for name, (ptype, access) in mpv.ALL_PROPERTIES.items():
@@ -44,7 +61,7 @@ class TestProperties(unittest.TestCase):
with self.swallow_mpv_errors():
rv = getattr(self.m, name)
if rv is not None: # Technically, any property can return None (even if of type e.g. int)
- self.assertEqual(type(rv), ptype, msg=name)
+ self.assertEqual(type(rv), type(ptype()))
def test_write(self):
for name, (ptype, access) in mpv.ALL_PROPERTIES.items():