[pitivi] test_track.py: udpate priority test cases for audio tranitions



commit 701de119b49edd8ffb8a76b8cd5d0d6de7c7eaa2
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date:   Wed Mar 10 01:19:11 2010 -0800

    test_track.py: udpate priority test cases for audio tranitions

 tests/test_track.py |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/tests/test_track.py b/tests/test_track.py
index 19d3453..47d8f68 100644
--- a/tests/test_track.py
+++ b/tests/test_track.py
@@ -103,6 +103,8 @@ class TestTrackObject(TestCase):
         self.failUnlessEqual(self.monitor.media_duration_changed_count, 1)
         self.failUnlessEqual(self.monitor.out_point_changed_count, 1)
 
+        # test video stream$
+        obj.stream_type = VideoStream
         priority = 100
         gnl_priority = 3 * 100 + 2 + obj._stagger
         obj.priority = priority
@@ -110,6 +112,16 @@ class TestTrackObject(TestCase):
         self.failUnlessEqual(gnl_object.props.priority, gnl_priority)
         self.failUnlessEqual(self.monitor.priority_changed_count, 1)
 
+        # test audio stream
+        obj.stream_type = AudioStream
+        priority = 55
+        gnl_priority = 4 * 55 + 2 + 2 * obj._stagger
+        obj.priority = priority
+        self.failUnlessEqual(obj.priority, priority)
+        self.failUnlessEqual(gnl_object.props.priority, gnl_priority)
+        self.failUnlessEqual(self.monitor.priority_changed_count, 2)
+
+
     def testChangePropertiesFromGnlObject(self):
         obj = self.track_object
         gnl_object = obj.gnl_object
@@ -137,6 +149,8 @@ class TestTrackObject(TestCase):
         self.failUnlessEqual(self.monitor.media_duration_changed_count, 1)
         self.failUnlessEqual(self.monitor.out_point_changed_count, 1)
 
+        # video stream
+        obj.stream_type = VideoStream
         gnl_priority = 100
         priority = (100 - 2 - obj._stagger) // 3
         gnl_object.props.priority = gnl_priority
@@ -144,6 +158,16 @@ class TestTrackObject(TestCase):
         self.failUnlessEqual(gnl_object.props.priority, gnl_priority)
         self.failUnlessEqual(self.monitor.priority_changed_count, 1)
 
+        # video stream
+        obj.stream_type = AudioStream
+        gnl_priority = 55
+        priority = (55 - 2 - obj._stagger) // 4
+        gnl_object.props.priority = gnl_priority
+        self.failUnlessEqual(obj.priority, priority)
+        self.failUnlessEqual(gnl_object.props.priority, gnl_priority)
+        self.failUnlessEqual(self.monitor.priority_changed_count, 2)
+
+
     def testTrimStart(self):
         obj = self.track_object
 



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