~ubuntu-branches/ubuntu/trusty/pitivi/trusty

« back to all changes in this revision

Viewing changes to tests/test_transitions.py

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-07-07 13:43:47 UTC
  • mto: (6.1.9 sid) (1.2.12)
  • mto: This revision was merged to the branch mainline in revision 32.
  • Revision ID: james.westby@ubuntu.com-20110707134347-cari9kxjiakzej9z
Tags: upstream-0.14.1
ImportĀ upstreamĀ versionĀ 0.14.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#
17
17
# You should have received a copy of the GNU Lesser General Public
18
18
# License along with this program; if not, write to the
19
 
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
 
# Boston, MA 02111-1307, USA.
 
19
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 
20
# Boston, MA 02110-1301, USA.
21
21
 
22
22
from common import TestCase
23
23
import gst
29
29
from pitivi.timeline.track import TrackError, \
30
30
    Transition, AudioTransition, VideoTransition
31
31
 
 
32
 
32
33
class TestTransitions(TestCase):
33
34
    def setUp(self):
34
35
        TestCase.setUp(self)
83
84
            track1.addTransition(tr)
84
85
 
85
86
        def transitionAddedCb(track, transition):
86
 
            values =(names[transition.a], names[transition.b])
 
87
            values = (names[transition.a], names[transition.b])
87
88
            result.append(values)
88
89
            transition_objects[values] = transition
89
90
 
90
91
        def transitionRemovedCb(track, transition):
91
 
            values =(names[transition.a], names[transition.b])
 
92
            values = (names[transition.a], names[transition.b])
92
93
            result.remove(values)
93
94
 
94
95
        track1.connect("transition-added", transitionAddedCb)
163
164
        self.failUnlessEqual(at.b_operation.props.start, 10 * gst.SECOND)
164
165
        self.failUnlessEqual(at.b_operation.props.duration, 5 * gst.SECOND)
165
166
 
166
 
 
167
 
 
168
167
        # make A longer
169
168
        objs["a"].duration = 11 * gst.SECOND
170
169
        self.failUnlessEqual(vt.start, 10 * gst.SECOND)
179
178
        self.failUnlessEqual(at.b_operation.props.start, 10 * gst.SECOND)
180
179
        self.failUnlessEqual(at.b_operation.props.duration, 6 * gst.SECOND)
181
180
 
182
 
 
183
 
 
184
181
        # move B earlier
185
182
        objs["b"].start = 9 * gst.SECOND
186
183
        self.failUnlessEqual(vt.start, 9 * gst.SECOND)
232
229
        self.failUnlessEqual(at.a_operation.props.priority, 9)
233
230
        self.failUnlessEqual(at.b_operation.props.priority, 11)
234
231
 
235
 
 
236
232
        # check controller for odd - even stagger
237
233
        vt.a.updatePosition(1)
238
234
        vt.b.updatePosition(2)
404
400
        removed = set()
405
401
 
406
402
        def transitionAddedCb(track, transition):
407
 
            pair =(names[transition.a], names[transition.b])
 
403
            pair = (names[transition.a], names[transition.b])
408
404
            result.append(pair)
409
405
            added.add(pair)
410
406
 
528
524
        self.failUnlessEqual(track1.valid_arrangement,
529
525
            True)
530
526
 
531
 
 
532
527
    def testUpdatesAfterEnablingUpdates(self):
533
528
        factory = self.factory
534
529
        stream = self.stream
556
551
        removed = set()
557
552
 
558
553
        def transitionAddedCb(track, transition):
559
 
            pair =(names[transition.a], names[transition.b])
 
554
            pair = (names[transition.a], names[transition.b])
560
555
            result.append(pair)
561
556
            added.add(pair)
562
557
 
684
679
 
685
680
        # check that intiial configuration matches
686
681
 
687
 
        expected = ["abcdefghijkl", [0, 1, 2, 3, 4, 5, 6, 7, 0, 8, 9,0]]
 
682
        expected = ["abcdefghijkl", [0, 1, 2, 3, 4, 5, 6, 7, 0, 8, 9, 0]]
688
683
        verify_result(expected)
689
684
 
690
685
        # remove a clip, which removes its associated transition