[pitivi] tests: Check redoing single-clip ungrouping
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] tests: Check redoing single-clip ungrouping
- Date: Wed, 14 Sep 2016 09:57:21 +0000 (UTC)
commit 550c4670560779b2bb9cb2f0ec1a82435e01f9f9
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Sat Sep 3 01:44:58 2016 +0200
tests: Check redoing single-clip ungrouping
Differential Revision: https://phabricator.freedesktop.org/D1295
tests/test_undo_timeline.py | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/tests/test_undo_timeline.py b/tests/test_undo_timeline.py
index 71c1d89..29e9105 100644
--- a/tests/test_undo_timeline.py
+++ b/tests/test_undo_timeline.py
@@ -81,23 +81,23 @@ class TestTimelineObserver(BaseTestUndoTimeline):
self.assertEqual([layer1, layer2, layer3], self.timeline.get_layers())
self.assertEqual([l.props.priority for l in [layer1, layer2, layer3]],
- list(range(3)))
+ list(range(3)))
with self.action_log.started("layer removed"):
self.timeline.remove_layer(layer2)
self.assertEqual([layer1, layer3], self.timeline.get_layers())
self.assertEqual([l.props.priority for l in [layer1, layer3]],
- list(range(2)))
+ list(range(2)))
self.action_log.undo()
self.assertEqual([layer1, layer2, layer3], self.timeline.get_layers())
self.assertEqual([l.props.priority for l in [layer1, layer2, layer3]],
- list(range(3)))
+ list(range(3)))
self.action_log.redo()
self.assertEqual([layer1, layer3], self.timeline.get_layers())
self.assertEqual([l.props.priority for l in [layer1, layer3]],
- list(range(2)))
+ list(range(2)))
class TestLayerObserver(BaseTestUndoTimeline):
@@ -191,7 +191,9 @@ class TestLayerObserver(BaseTestUndoTimeline):
self.action_log.redo()
self.assertFalse(clip1 in self.getTimelineClips())
- def testUngroup(self):
+ def test_ungroup_group_clip(self):
+ # This test is in TestLayerObserver because the relevant operations
+ # recorded are clip-added and clip-removed.
uri = common.get_sample_uri("tears_of_steel.webm")
asset = GES.UriClipAsset.request_sync(uri)
clip1 = asset.extract()
@@ -220,6 +222,14 @@ class TestLayerObserver(BaseTestUndoTimeline):
self.assertEqual(5 * Gst.SECOND, timeline_clips[0].get_start())
self.assertEqual(0.5 * Gst.SECOND, timeline_clips[0].get_duration())
+ self.action_log.redo()
+ timeline_clips = list(self.getTimelineClips())
+ self.assertEqual(2, len(timeline_clips), timeline_clips)
+ self.assertEqual(5 * Gst.SECOND, timeline_clips[0].get_start())
+ self.assertEqual(0.5 * Gst.SECOND, timeline_clips[0].get_duration())
+ self.assertEqual(5 * Gst.SECOND, timeline_clips[1].get_start())
+ self.assertEqual(0.5 * Gst.SECOND, timeline_clips[1].get_duration())
+
def testSplitClip(self):
clip = GES.TitleClip()
clip.set_start(0 * Gst.SECOND)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]