diff options
author | Alexandru Băluț <alexandru.balut@gmail.com> | 2016-09-06 15:49:49 +0200 |
---|---|---|
committer | Thibault Saunier <thibault.saunier@osg.samsung.com> | 2016-09-13 16:47:21 -0300 |
commit | 2df506e5bac247922a13429390ebd57051db3ac6 (patch) | |
tree | 4db5134a4341690824dad4468465414ef4896869 | |
parent | 760909bc9ebd3dab32547452fd4383237add8537 (diff) |
tests_: Make sure child-removed is emitted when ungrouping
Reviewed-by: Thibault Saunier <thibault.saunier@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D1301
-rw-r--r-- | tests/check/python/test_group.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/check/python/test_group.py b/tests/check/python/test_group.py index 5e60ee19..ad27444d 100644 --- a/tests/check/python/test_group.py +++ b/tests/check/python/test_group.py @@ -25,6 +25,7 @@ gi.require_version("GES", "1.0") from gi.repository import Gst # noqa from gi.repository import GES # noqa import unittest # noqa +from unittest import mock Gst.init(None) GES.init() @@ -149,3 +150,20 @@ class TestGroup(unittest.TestCase): clips = layer2.get_clips() self.assertEqual(len(clips), 4) + + def test_remove_emits_signal(self): + clip1 = GES.TestClip.new() + self.layer.add_clip(clip1) + + group = GES.Group.new() + child_removed_cb = mock.Mock() + group.connect("child-removed", child_removed_cb) + + group.add(clip1) + group.remove(clip1) + child_removed_cb.assert_called_once_with(group, clip1) + + group.add(clip1) + child_removed_cb.reset_mock() + group.ungroup(recursive=False) + child_removed_cb.assert_called_once_with(group, clip1) |