AS_PATH_PYTHON([2.1])
AG_GST_PLUGIN_DOCS([1.3],[2.1])
-dnl check for python
-AM_PATH_PYTHON
-AC_MSG_CHECKING(for python >= 2.3)
-prog="
-import sys, string
-minver = (2,3,0,'final',0)
-if sys.version_info < minver:
- sys.exit(1)
-sys.exit(0)"
-
-if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
-then
- HAVE_PYTHON=yes
- AC_MSG_RESULT(okay)
-else
- HAVE_PYTHON=no
- AC_MSG_RESULT(no python)
-fi
-
dnl check for pygobject
-AC_SUBST(PYGOBJECT_REQ, 4.22)
+AC_SUBST(PYGOBJECT_REQ, 3.0)
PKG_CHECK_MODULES(PYGOBJECT, pygobject-3.0 >= $PYGOBJECT_REQ,
[
HAVE_PYGOBJECT=yes
AM_CONDITIONAL(WITH_PYTHON, [test "x$HAVE_PYGOBJECT" = "xyes"])
-dnl check for pygobject
+dnl check for gst-validate
PKG_CHECK_MODULES(GST_VALIDATE, gst-validate-1.0 >= 1.5.90,
[
HAVE_GST_VALIDATE=yes
GST_PLUGINS_SELECTED=`echo $GST_PLUGINS_SELECTED | $SED -e s/festival//`
fi
+dnl *** checks for nosetests ***
+
+AC_MSG_CHECKING(for nosetests)
+NOSETESTS=nosetests
+if $NOSETESTS 1>&AC_FD_CC 2>&AC_FD_CC
+then
+ HAVE_NOSETESTS=yes
+ AC_MSG_RESULT(yes)
+else
+ HAVE_NOSETESTS=no
+ AC_MSG_RESULT(no nosetests)
+fi
+AC_SUBST([NOSETESTS])
+AM_CONDITIONAL(HAVE_NOSETESTS, test "x$HAVE_NOSETESTS" = "xyes")
+
dnl *** checks for types/defines ***
dnl *** checks for structures ***
--- /dev/null
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2015, Thibault Saunier
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the
+# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+import gi
+
+gi.require_version("Gst", "1.0")
+gi.require_version("GES", "1.0")
+
+from gi.repository import Gst # noqa
+from gi.repository import GES # noqa
+import unittest # noqa
+
+Gst.init(None)
+GES.init()
+
+
+class TestCopyPaste(unittest.TestCase):
+
+ def setUp(self):
+ self.timeline = GES.Timeline.new_audio_video()
+ self.assertEqual(len(self.timeline.get_tracks()), 2)
+ self.layer = self.timeline.append_layer()
+
+ def testCopyGroup(self):
+ clip1 = GES.TestClip.new()
+ clip1.props.duration = 10
+
+ self.layer.add_clip(clip1)
+
+ self.assertEqual(len(clip1.get_children(False)), 2)
+
+ group = GES.Group.new()
+ self.assertTrue(group.add(clip1))
+
+ self.assertEqual(len(group.get_children(False)), 1)
+
+ group_copy = group.copy(True)
+ self.assertEqual(len(group_copy.get_children(False)), 0)
+
+ self.assertTrue(group_copy.paste(10))
+ clips = self.layer.get_clips()
+ self.assertEqual(len(clips), 2)
+ self.assertEqual(clips[1].props.start, 10)
+
+ clips[1].edit([], 1, GES.EditMode.EDIT_NORMAL, GES.Edge.EDGE_NONE, 10)
+ clips = self.layer.get_clips()
+ self.assertEqual(len(clips), 1)