[pitivi] test_integration.py: test importing files
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pitivi] test_integration.py: test importing files
- Date: Fri, 20 Nov 2009 07:47:38 +0000 (UTC)
commit fd81912a082c0672fba201b795ecf886b425c3db
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date: Mon Oct 26 14:11:31 2009 -0700
test_integration.py: test importing files
tests/test_integration.py | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)
---
diff --git a/tests/test_integration.py b/tests/test_integration.py
index 6e3c621..8571767 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -27,6 +27,12 @@ TestCase = unittest.TestCase
from pitivi.application import InteractivePitivi
import pitivi.instance
import gobject
+import os.path
+
+base_uri = "file:///" + os.getcwd() + "/"
+test1 = base_uri + "test1.ogg"
+test2 = base_uri + "test2.ogg"
+test3 = base_uri + "test3.ogg"
class WatchDog(object):
@@ -149,5 +155,37 @@ class Base(TestCase):
del self.ptv
TestCase.tearDown(self)
+class TestImport(Base):
+
+ """Test discoverer, sourcelist, and project integration. When the new
+ project loads, attempt to add both existing and non-existing sources. Make
+ sure that an error is emitted when a source fails to load, and that
+ source-added is emitted when sources are loaded successfully."""
+
+ def setUp(self):
+ self.factories = set()
+ self.errors = set()
+ Base.setUp(self)
+
+ def _sourceAdded(self, sourcelist, factory):
+ self.factories.add(factory.uri)
+
+ def _discoveryError(self, sourcelist, uri, reason, unused):
+ self.errors.add(uri)
+
+ def _readyCb(self, soucelist):
+ self.failUnlessEqual(self.factories, set((test1, test2)))
+ self.failUnlessEqual(self.errors, set((test3,)))
+ self.ptv.current._dirty = False
+ self.ptv.shutdown()
+
+ def _projectLoadedCb(self, pitivi, project):
+ self.ptv.current.sources.connect("source-added", self._sourceAdded)
+ self.ptv.current.sources.connect("discovery-error", self._discoveryError)
+ self.ptv.current.sources.connect("ready", self._readyCb)
+ self.ptv.current.sources.addUri(test1)
+ self.ptv.current.sources.addUri(test2)
+ self.ptv.current.sources.addUri(test3)
+
if __name__ == "__main__":
unittest.main()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]