[vlc-commits] Add Media.get_meta tests

Olivier Aubert git at videolan.org
Sun Jul 12 22:40:42 CEST 2020


vlc/python | branch: master | Olivier Aubert <contact at olivieraubert.net> | Sun Jul 12 22:40:20 2020 +0200| [3c9cf995e6f8d16aebc1b8a707441d9ee2048151] | committer: Olivier Aubert

Add Media.get_meta tests

> http://git.videolan.org/gitweb.cgi/vlc/python.git/?a=commit;h=3c9cf995e6f8d16aebc1b8a707441d9ee2048151
---

 tests/samples/sample.mp4 | Bin 383631 -> 384605 bytes
 tests/test.py            |  12 ++++++++++++
 2 files changed, 12 insertions(+)

diff --git a/tests/samples/sample.mp4 b/tests/samples/sample.mp4
index 1fc4788..a1646c6 100644
Binary files a/tests/samples/sample.mp4 and b/tests/samples/sample.mp4 differ
diff --git a/tests/test.py b/tests/test.py
index 20fc321..479b005 100755
--- a/tests/test.py
+++ b/tests/test.py
@@ -185,6 +185,18 @@ class TestVLCAPI(unittest.TestCase):
         self.assertEqual(audiotrack.bitrate, 83051)
         self.assertEqual(m.get_duration(), 5568)
 
+    def test_meta_get(self):
+        self.assertTrue(os.path.exists(SAMPLE))
+        m = vlc.Media(SAMPLE)
+        m.parse()
+        self.assertEqual(m.get_meta(vlc.Meta.Title), 'Title')
+        self.assertEqual(m.get_meta(vlc.Meta.Artist), 'Artist')
+        self.assertEqual(m.get_meta(vlc.Meta.Description), 'Comment')
+        self.assertEqual(m.get_meta(vlc.Meta.Album), 'Album')
+        self.assertEqual(m.get_meta(vlc.Meta.AlbumArtist), 'Album Artist')
+        self.assertEqual(m.get_meta(vlc.Meta.Date), '2013')
+        self.assertEqual(m.get_meta(vlc.Meta.Genre), 'Sample')
+
     def notest_log_get_context(self):
         """Semi-working test for log_get_context.
 



More information about the vlc-commits mailing list