conduit r1853 - in trunk/test/python-tests: . data



Author: arosenfeld
Date: Mon Feb  9 21:17:54 2009
New Revision: 1853
URL: http://svn.gnome.org/viewvc/conduit?rev=1853&view=rev

Log:
A few forgotten files from the last commit.


Added:
   trunk/test/python-tests/TestCoreAudio.py
   trunk/test/python-tests/data/1.mp3   (contents, props changed)

Added: trunk/test/python-tests/TestCoreAudio.py
==============================================================================
--- (empty file)
+++ trunk/test/python-tests/TestCoreAudio.py	Mon Feb  9 21:17:54 2009
@@ -0,0 +1,45 @@
+#common sets up the conduit environment
+from common import *
+
+import threading
+
+import conduit
+import conduit.datatypes.Audio as Audio
+
+import gobject
+import gtk
+gtk.gdk.threads_init()
+
+
+mainloop = gobject.MainLoop()
+
+def run_audio_tests():
+    try:
+        #ok("Getting audio", True)
+        #print 'Getting audio'
+        audio = new_audio()
+        #print 'Getting tags'
+        media_tags = audio.get_media_tags()
+        expected_tags = {'title': 'Title',
+            'artist': 'Artist',
+            'album': 'Album',
+            'genre': 'Indie'}
+        for name, value in expected_tags.iteritems():
+            ok("Expected: %s = %s, Got %s = %s" % (name, expected_tags[name], name, name in media_tags and media_tags[name]),
+                name in media_tags and expected_tags[name] == media_tags[name])
+    except Exception, excp:
+        print "Exception %s" % excp
+    finally:
+        mainloop.quit()
+
+
+def idle_cb():
+    threading.Thread(target=run_audio_tests).start()
+    return False
+
+
+gobject.idle_add(idle_cb)
+mainloop.run()
+finished()
+
+

Added: trunk/test/python-tests/data/1.mp3
==============================================================================
Binary file. No diff available.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]