[pitivi] test_integration.py: make Configuration.matches() test more complete
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pitivi] test_integration.py: make Configuration.matches() test more complete
- Date: Fri, 20 Nov 2009 07:48:13 +0000 (UTC)
commit 30936f9576a5ded658e073df3e25403a3c53a5a8
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date: Wed Nov 4 15:25:07 2009 -0800
test_integration.py: make Configuration.matches() test more complete
tests/test_integration.py | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/tests/test_integration.py b/tests/test_integration.py
index c98d19e..5c2cc04 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -132,8 +132,13 @@ class Configuration(object):
return set((source[1] for source in self.sources if
len(source) > 2))
+ def getGoodSources(self):
+ return (source for source in self.sources if len(source) > 2)
+
def matches(self, instance_runner):
- for name, uri, props in self.sources:
+ for name, uri, props in self.getGoodSources():
+ if not hasattr(instance_runner, name):
+ raise Exception("Project missing source %s" % name)
timelineObject = getattr(instance_runner, name)
if timelineObject.factory.uri != uri:
raise Exception("%s has wrong factory type!" % name)
@@ -142,6 +147,12 @@ class Configuration(object):
if not getattr(timelineObject, prop) == value:
raise Exception("'%s'.%s != %r" % (uri, prop, value))
+ names = set((source[0] for source in self.getGoodSources()))
+ timelineObjects = set(instance_runner.timelineObjects.iterkeys())
+ if names != timelineObjects:
+ raise Exception("Project has extra sources: %r" % (timelineObjects -
+ names))
+
def __iter__(self):
return (source for source in self.sources if len(source) > 2)
@@ -167,6 +178,7 @@ class InstanceRunner(Signallable):
self.project = None
self.timeline = None
self.tracks = {}
+ self.timelineObjects = {}
self.pending_configuration = None
self.audioTracks = 0
self.videoTracks = 0
@@ -227,6 +239,7 @@ class InstanceRunner(Signallable):
timelineObject = self.timeline.addSourceFactory(factory)
setattr(self, name, timelineObject)
+ self.timelineObjects[name] = timelineObject
for trackObject in timelineObject.track_objects:
track = self.tracks[trackObject.track]
setattr(track, name, trackObject)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]