[pitivi: 1/13] Fix discoverer tests.
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi: 1/13] Fix discoverer tests.
- Date: Mon, 16 Mar 2009 08:03:55 -0400 (EDT)
commit 080e76307c8dd9224fa322ef54e1b15e7bf414fa
Author: Alessandro Decina <alessandro decina collabora co uk>
Date: Wed Mar 11 13:42:54 2009 +0100
Fix discoverer tests.
---
tests/test_discoverer.py | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/tests/test_discoverer.py b/tests/test_discoverer.py
index 7807b45..361a900 100644
--- a/tests/test_discoverer.py
+++ b/tests/test_discoverer.py
@@ -256,19 +256,29 @@ class TestAnalysis(TestCase):
self.failUnlessEqual(bag['called'], True)
def testBusError(self):
+ def not_media_file_cb(discoverer, uri, error, debug, dic):
+ dic['uri'] = uri
+ dic['error'] = error
+ dic['debug'] = debug
+
+ dic = {}
+ self.discoverer.connect('not_media_file', not_media_file_cb, dic)
+
src = gst.Pad('src', gst.PAD_SRC)
gerror = gst.GError(gst.STREAM_ERROR, gst.STREAM_ERROR_FAILED, 'meh')
message = gst.message_new_error(src, gerror, 'debug1')
self.failUnlessEqual(self.discoverer.error, None)
+ self.discoverer.addFile('popme')
self.discoverer._busMessageErrorCb(None, message)
- self.failUnlessEqual(self.discoverer.error_debug, 'debug1')
+ self.failUnlessEqual(dic['debug'], 'debug1')
# errors shouldn't be overridden
gerror = gst.GError(gst.STREAM_ERROR, gst.STREAM_ERROR_FAILED, 'muh')
message = gst.message_new_error(src, gerror, 'debug2')
+ self.discoverer.addFile('popme')
self.discoverer._busMessageErrorCb(None, message)
- self.failUnlessEqual(self.discoverer.error_debug, 'debug1')
+ self.failUnlessEqual(dic['debug'], 'debug2')
def testNewDecodedPadFixed(self):
bag = {'called': 0}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]