[pitivi: 5/14] tests: add more tests for Timeline.getPreviousTimelineObject
- From: Edward Hervey <edwardrv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi: 5/14] tests: add more tests for Timeline.getPreviousTimelineObject
- Date: Fri, 1 Oct 2010 12:16:35 +0000 (UTC)
commit 4f2bb910af813755a85cd46b60c2b6c277c03013
Author: Alessandro Decina <alessandro d gmail com>
Date: Wed Sep 29 13:58:34 2010 +0200
tests: add more tests for Timeline.getPreviousTimelineObject
tests/test_timeline.py | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/tests/test_timeline.py b/tests/test_timeline.py
index 7ff78d2..1b36e01 100644
--- a/tests/test_timeline.py
+++ b/tests/test_timeline.py
@@ -474,10 +474,29 @@ class TestTimeline(TestCase):
prev = timeline.getPreviousTimelineObject(timeline_object2, priority=None)
self.failUnlessEqual(prev, timeline_object4)
- timeline_object3.start = 8 * gst.SECOND
- # same start
+ def testGetPreviousTimelineObjectSameStart(self):
+ timeline_object1 = self.makeTimelineObject()
+ timeline_object2 = self.makeTimelineObject()
+ timeline = self.timeline
+
+ timeline_object1.start = 1 * gst.SECOND
+ timeline_object1.duration = 5 * gst.SECOND
+ timeline_object1.priority = 1
+
+ timeline_object2.start = 1 * gst.SECOND
+ timeline_object2.duration = 5 * gst.SECOND
+ timeline_object2.priority = 2
+
+ self.failUnlessRaises(TimelineError,
+ timeline.getPreviousTimelineObject, timeline_object1)
+ self.failUnlessRaises(TimelineError,
+ timeline.getPreviousTimelineObject, timeline_object2)
+
prev = timeline.getPreviousTimelineObject(timeline_object2, priority=None)
- self.failUnlessEqual(prev, timeline_object3)
+ self.failUnlessEqual(prev, timeline_object1)
+
+ prev = timeline.getPreviousTimelineObject(timeline_object1, priority=None)
+ self.failUnlessEqual(prev, timeline_object2)
def testGetNextTrackObject(self):
timeline_object1 = self.makeTimelineObject()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]