[pitivi/ges: 50/287] build: Fix the build system



commit a38d76015898dad1f49ecf8fd36787d91b6727b8
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Sat Oct 1 10:41:40 2011 -0300

    build: Fix the build system
    
    "Fix" the tesuite:
      * remove all test that don't make sense anymore
      * Comment test that need to be reimplemented (test_projectmanager and
        test_timeline_undo)
    
    Make check && make distcheck now passes

 pitivi/factories/base.py          |  285 ------
 pitivi/timeline/Makefile.am       |    2 +-
 pitivi/ui/trackobject.py          |    6 +-
 po/POTFILES.in                    |    6 -
 tests/Makefile.am                 |   18 -
 tests/common.py                   |   67 +--
 tests/test_action.py              |  285 ------
 tests/test_alpha_passthrough.py   |  242 -----
 tests/test_encode.py              |  130 ---
 tests/test_etree_formatter.py     |  772 ---------------
 tests/test_factories_base.py      |  193 ----
 tests/test_factories_file.py      |  250 -----
 tests/test_factories_operation.py |   54 -
 tests/test_gap.py                 |  220 -----
 tests/test_pipeline.py            |  321 ------
 tests/test_pipeline_action.py     |  191 ----
 tests/test_projectmanager.py      |  707 +++++++-------
 tests/test_seeker.py              |   85 --
 tests/test_sourcelist.py          |  101 --
 tests/test_stream.py              |  283 ------
 tests/test_timeline.py            | 1929 -------------------------------------
 tests/test_timeline_factory.py    |  321 ------
 tests/test_timeline_undo.py       |  548 ++++++------
 tests/test_track.py               |  581 -----------
 tests/test_transitions.py         |  704 --------------
 25 files changed, 638 insertions(+), 7663 deletions(-)
---
diff --git a/pitivi/timeline/Makefile.am b/pitivi/timeline/Makefile.am
index 7592c9f..6c90d9a 100644
--- a/pitivi/timeline/Makefile.am
+++ b/pitivi/timeline/Makefile.am
@@ -1,7 +1,7 @@
 timelinedir = $(libdir)/pitivi/python/pitivi/timeline
 
 timeline_PYTHON = 	\
-	__init__.py	\
+	__init__.py	    \
 	align.py        \
 	alignalgs.py    \
 	extract.py      \
diff --git a/pitivi/ui/trackobject.py b/pitivi/ui/trackobject.py
index 72a39da..1d71ec7 100644
--- a/pitivi/ui/trackobject.py
+++ b/pitivi/ui/trackobject.py
@@ -1,20 +1,18 @@
 import goocanvas
-import gobject
 import gtk
 import os.path
 import pango
 import cairo
+
 import pitivi.configure as configure
-from urllib import unquote
 from gettext import gettext as _
 from pitivi.receiver import receiver, handler
 from view import View
 import controller
+
 from zoominterface import Zoomable
 from pitivi.timeline.timeline import SELECT, SELECT_ADD, UNSELECT, \
     SELECT_BETWEEN, MoveContext, TrimStartContext, TrimEndContext
-from preview import Preview
-from pitivi.ui.curve import Curve
 import gst
 from common import LAYER_HEIGHT_EXPANDED, LAYER_HEIGHT_COLLAPSED
 from common import LAYER_SPACING, unpack_cairo_pattern, unpack_cairo_gradient
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 5134d9a..ccdb9fe 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -15,15 +15,9 @@ data/pitivi.desktop.in.in
 pitivi/application.py
 pitivi/check.py
 pitivi/effects.py
-pitivi/factories/base.py
-pitivi/factories/file.py
-pitivi/factories/operation.py
-pitivi/formatters/format.py
-pitivi/formatters/etree.py
 pitivi/projectmanager.py
 pitivi/project.py
 pitivi/settings.py
-pitivi/stream.py
 pitivi/ui/alignmentprogress.py
 pitivi/ui/basetabs.py
 pitivi/ui/clipproperties.py
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a1003aa..991239f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -2,32 +2,14 @@
 # Please keep the test lists below ordered.
 
 tests = \
-	test_action.py \
-	test_alpha_passthrough.py \
 	test_basic.py \
 	test_binary_search.py \
 	test_cache.py \
 	test_common.py \
-	test_encode.py \
-	test_etree_formatter.py \
-	test_factories_base.py \
-	test_factories_file.py \
-	test_factories_operation.py \
-	test_formatters_base.py \
-	test_gap.py \
-	test_pipeline_action.py \
-	test_pipeline.py \
 	test_projectmanager.py \
-	test_seeker.py \
 	test_settings.py \
 	test_signallable.py \
-	test_sourcelist.py \
-	test_stream.py \
-	test_timeline_factory.py \
-	test_timeline.py \
 	test_timeline_undo.py \
-	test_track.py \
-	test_transitions.py \
 	test_undo.py \
 	test_utils.py
 
diff --git a/tests/common.py b/tests/common.py
index b44d778..e347b55 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -6,16 +6,12 @@ import gst
 import os
 import gc
 import unittest
-from pitivi.factories.base import ObjectFactory, SourceFactory, SinkFactory
-from pitivi.factories.operation import EffectFactory
-from pitivi.pipeline import Pipeline
 
 detect_leaks = os.environ.get("PITIVI_TEST_DETECT_LEAKS", "1") not in ("0", "")
 
 
 class TestCase(unittest.TestCase):
-    _tracked_types = (gst.MiniObject, gst.Element, gst.Pad, gst.Caps,
-            ObjectFactory, Pipeline)
+    _tracked_types = (gst.MiniObject, gst.Element, gst.Pad, gst.Caps)
 
     def gctrack(self):
         self.gccollect()
@@ -80,49 +76,6 @@ class TestCase(unittest.TestCase):
         unittest.TestCase.run(self, result)
 
 
-# Some fake factories
-class FakeSourceFactory(SourceFactory):
-    def __init__(self, factoryname="fakesrc", *args, **kwargs):
-        SourceFactory.__init__(self, "fakesrc://", *args, **kwargs)
-        self._factoryname = factoryname
-
-    def _makeBin(self, output_stream=None):
-        return gst.element_factory_make(self._factoryname)
-
-    def _releaseBin(self, bin):
-        pass
-
-
-class FakeSinkFactory(SinkFactory):
-    def __init__(self, factoryname="fakesink", *args, **kwargs):
-        SinkFactory.__init__(self, *args, **kwargs)
-        self.__factoryname = factoryname
-
-    def _makeBin(self, output_stream=None):
-        return gst.element_factory_make(self.__factoryname)
-
-
-class FakeGnlFactory(SourceFactory):
-
-    def __init__(self, duration=10 * gst.SECOND, media_duration=10 * gst.SECOND,
-                 *args, **kwargs):
-        self.__duration = duration
-        self.__media_duration = media_duration
-        SourceFactory.__init__(self, "fakegnl://", *args, **kwargs)
-
-    def _makeBin(self, output_stream=None):
-        # let's make a gnlsource with videotestsrc inside of it
-        gnl = gst.element_factory_make("gnlsource")
-        vs = gst.element_factory_make("videotestsrc")
-        gnl.add(vs)
-        gnl.props.duration = self.__duration
-        gnl.props.media_duration = self.__media_duration
-        return gnl
-
-    def _releaseBin(self, bin):
-        pass
-
-
 class SignalMonitor(object):
     def __init__(self, obj, *signals):
         self.signals = signals
@@ -153,21 +106,3 @@ class SignalMonitor(object):
         setattr(self, field, getattr(self, field, 0) + 1)
         field = self._getSignalCollectName(name)
         setattr(self, field, getattr(self, field, []) + [args[:-1]])
-
-
-class StubFactory(SourceFactory):
-    def __init__(self):
-        SourceFactory.__init__(self, "stub://")
-        self.duration = 42 * gst.SECOND
-
-    def _makeBin(self, stream=None):
-        return gst.element_factory_make('fakesrc')
-
-    def _releaseBin(self, bin):
-        pass
-
-
-class FakeEffectFactory(EffectFactory):
-    def __init__(self):
-        EffectFactory.__init__(self, 'identity', "identity")
-        self.duration = 42 * gst.SECOND
diff --git a/tests/test_projectmanager.py b/tests/test_projectmanager.py
index cd03bba..852723a 100644
--- a/tests/test_projectmanager.py
+++ b/tests/test_projectmanager.py
@@ -19,353 +19,360 @@
 # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 # Boston, MA 02110-1301, USA.
 
-from unittest import TestCase
-
-from pitivi.projectmanager import ProjectManager
-from pitivi.formatters.base import Formatter, \
-        FormatterError, FormatterLoadError
-import os
-import gst
-from pitivi.utils import uri_is_reachable
-import time
-
-
-class MockProject(object):
-    settings = None
-    format = None
-    uri = None
-    has_mods = True
-
-    def hasUnsavedModifications(self):
-        return self.has_mods
-
-    def release(self):
-        pass
-
-    def disconnect_by_function(self, ignored):
-        pass
-
-
-class ProjectManagerListener(object):
-    def __init__(self, manager):
-        self.manager = manager
-        self.connectToProjectManager(self.manager)
-        self._reset()
-
-    def _reset(self):
-        self.signals = []
-
-    def connectToProjectManager(self, manager):
-        for signal in ("new-project-loading", "new-project-loaded",
-                "new-project-created", "new-project-failed", "missing-uri",
-                "closing-project", "project-closed"):
-            self.manager.connect(signal, self._recordSignal, signal)
-
-    def _recordSignal(self, *args):
-        signal = args[-1]
-        args = args[1:-1]
-        self.signals.append((signal, args))
-
-        return True
-
-
-class TestProjectManager(TestCase):
-    def setUp(self):
-        self.manager = ProjectManager()
-        self.listener = ProjectManagerListener(self.manager)
-        self.signals = self.listener.signals
-
-    def testLoadProjectFailedUnknownFormat(self):
-        """
-        Check that new-project-failed is emitted when we don't have a suitable
-        formatter.
-        """
-        uri = "file:///Untitled.meh"
-        self.manager.loadProject(uri)
-        self.failUnlessEqual(len(self.signals), 2)
-
-        # loading
-        name, args = self.signals[0]
-        self.failUnlessEqual(args[0], uri)
-
-        # failed
-        name, args = self.signals[1]
-        self.failUnlessEqual(name, "new-project-failed")
-        signalUri, exception = args
-        self.failUnlessEqual(uri, signalUri)
-        self.failUnless(isinstance(exception, FormatterLoadError))
-
-    def testLoadProjectFailedCloseCurrent(self):
-        """
-        Check that new-project-failed is emited if we can't close the current
-        project instance.
-        """
-        state = {"tried-close": False}
-
-        def close():
-            state["tried-close"] = True
-            return False
-        self.manager.closeRunningProject = close
-
-        uri = "file:///Untitled.xptv"
-        self.manager.loadProject(uri)
-        self.failUnlessEqual(len(self.signals), 2)
-
-        # loading
-        name, args = self.signals[0]
-        self.failUnlessEqual(args[0], uri)
-
-        # failed
-        name, args = self.signals[1]
-        self.failUnlessEqual(name, "new-project-failed")
-        signalUri, exception = args
-        self.failUnlessEqual(uri, signalUri)
-        self.failUnless(isinstance(exception, FormatterLoadError))
-        self.failUnless(state["tried-close"])
-
-    def testLoadProjectFailedProxyFormatter(self):
-        """
-        Check that new-project-failed is proxied when a formatter emits it.
-        """
-        class FailFormatter(Formatter):
-            def _validateUri(self, uri):
-                pass
-
-            def _loadProject(self, location, project=None):
-                raise FormatterError()
-        self.manager._getFormatterForUri = lambda uri: FailFormatter([])
-
-        uri = "file:///Untitled.xptv"
-        self.manager.loadProject(uri)
-        self.failUnlessEqual(len(self.signals), 3)
-
-        # loading
-        name, args = self.signals[0]
-        self.failUnlessEqual(name, "new-project-loading")
-        self.failUnlessEqual(args[0], uri)
-
-        # created
-        name, args = self.signals[1]
-        self.failUnlessEqual(name, "new-project-created")
-
-        # failed
-        name, args = self.signals[2]
-        self.failUnlessEqual(name, "new-project-failed")
-        signalUri, exception = args
-        self.failUnlessEqual(uri, signalUri)
-        self.failUnless(isinstance(exception, FormatterError))
-
-    def testLoadProjectMissingUri(self):
-        class MissingUriFormatter(Formatter):
-            def _validateUri(self, uri):
-                pass
-
-            def _loadProject(self, location, project):
-                self._finishLoadingProject(project)
-
-            def _getSources(self):
-                # this will emit missing-uri
-                self.validateSourceURI("file:///icantpossiblyexist", None)
-                return []
-
-            def _fillTimeline(self):
-                pass
-        self.manager._getFormatterForUri = lambda uri: MissingUriFormatter([])
-
-        uri = "file:///Untitled.xptv"
-        self.manager.loadProject(uri)
-        self.failUnlessEqual(len(self.signals), 4)
-
-        # loading
-        name, args = self.signals[0]
-        self.failUnlessEqual(name, "new-project-loading")
-        self.failUnlessEqual(args[0], uri)
-
-        name, args = self.signals[1]
-        self.failUnlessEqual(name, "new-project-created")
-        self.failUnlessEqual(args[0].uri, uri)
-
-        # failed
-        name, args = self.signals[2]
-        self.failUnlessEqual(name, "missing-uri")
-        formatter, signalUri, unused_factory = args
-        self.failUnlessEqual(signalUri, "file:///icantpossiblyexist")
-
-    def testLoadProjectLoaded(self):
-        class EmptyFormatter(Formatter):
-            def _validateUri(self, uri):
-                pass
-
-            def _loadProject(self, location, project):
-                self._finishLoadingProject(project)
-
-            def _getSources(self):
-                return []
-
-            def _fillTimeline(self):
-                pass
-        self.manager._getFormatterForUri = lambda uri: EmptyFormatter([])
-
-        uri = "file:///Untitled.xptv"
-        self.manager.loadProject(uri)
-        self.failUnlessEqual(len(self.signals), 3)
-
-        # loading
-        name, args = self.signals[0]
-        self.failUnlessEqual(args[0], uri)
-
-        name, args = self.signals[1]
-        self.failUnlessEqual(name, "new-project-created")
-        project = args[0]
-        self.failUnlessEqual(uri, project.uri)
-
-        name, args = self.signals[2]
-        self.failUnlessEqual(name, "new-project-loaded")
-        project = args[0]
-        self.failUnlessEqual(uri, project.uri)
-
-    def testCloseRunningProjectNoProject(self):
-        self.failUnless(self.manager.closeRunningProject())
-        self.failIf(self.signals)
-
-    def testCloseRunningProjectRefuseFromSignal(self):
-        def closing(manager, project):
-            return False
-
-        self.manager.current = MockProject()
-        self.manager.current.has_mods = False
-        self.manager.current.uri = "file:///ciao"
-        self.manager.connect("closing-project", closing)
-
-        self.failIf(self.manager.closeRunningProject())
-        self.failUnlessEqual(len(self.signals), 1)
-        name, args = self.signals[0]
-        self.failUnlessEqual(name, "closing-project")
-        project = args[0]
-        self.failUnless(project is self.manager.current)
-
-    def testCloseRunningProject(self):
-        current = self.manager.current = MockProject()
-        self.manager.current.has_mods = False
-        self.failUnless(self.manager.closeRunningProject())
-        self.failUnlessEqual(len(self.signals), 2)
-
-        name, args = self.signals[0]
-        self.failUnlessEqual(name, "closing-project")
-        project = args[0]
-        self.failUnless(project is current)
-
-        name, args = self.signals[1]
-        self.failUnlessEqual(name, "project-closed")
-        project = args[0]
-        self.failUnless(project is current)
-
-        self.failUnlessEqual(self.manager.current, None)
-
-    def testNewBlankProjectCantCloseCurrent(self):
-        def closing(manager, project):
-            return False
-
-        self.manager.current = MockProject()
-        self.manager.current.has_mods = False
-        self.manager.current.uri = "file:///ciao"
-        self.manager.connect("closing-project", closing)
-        self.failIf(self.manager.newBlankProject())
-        self.failUnlessEqual(len(self.signals), 1)
-        signal, args = self.signals[0]
-        self.failUnlessEqual(signal, "closing-project")
-
-    def testNewBlankProject(self):
-        self.failUnless(self.manager.newBlankProject())
-        self.failUnlessEqual(len(self.signals), 3)
-
-        name, args = self.signals[0]
-        self.failUnlessEqual(name, "new-project-loading")
-        uri = args[0]
-        self.failUnlessEqual(uri, None)
-
-        name, args = self.signals[1]
-        self.failUnlessEqual(name, "new-project-created")
-        project = args[0]
-        self.failUnlessEqual(uri, project.uri)
-
-        name, args = self.signals[2]
-        self.failUnlessEqual(name, "new-project-loaded")
-        project = args[0]
-        self.failUnless(project is self.manager.current)
-
-    def testSaveProject(self):
-        uri = "file://" + os.path.abspath("testproject.xptv")
-        uri2 = "file://" + os.path.abspath("testproject2.xptv")
-        path = gst.uri_get_location(uri)
-        path2 = gst.uri_get_location(uri2)
-
-        # unlink any existing project files
-        try:
-            os.unlink(path)
-            os.unlink(path2)
-        except OSError:
-            pass
-
-        # save a project
-        self.failUnless(self.manager.newBlankProject())
-        self.failUnless(self.manager.saveProject(
-            self.manager.current, uri, True))
-        self.failUnless(uri_is_reachable(uri))
-
-        # wait a bit
-        time.sleep(1.0)
-
-        # save project under new path
-        self.failUnless(self.manager.saveProject(
-            self.manager.current, uri2, True))
-        self.failUnless(uri_is_reachable(uri2))
-
-        # make sure the old path and the new path have different mtime
-        mtime = os.path.getmtime(path)
-        mtime2 = os.path.getmtime(path2)
-        self.failUnless(mtime < mtime2)
-
-        # wait a bit more
-        time.sleep(1.0)
-
-        # save project again under new path (by omitting uri arg)
-        self.failUnless(self.manager.saveProject(
-            self.manager.current, overwrite=True))
-
-        # regression test for bug 594396
-        # make sure we didn't save to the old URI
-        self.failUnlessEqual(mtime, os.path.getmtime(path))
-        # make sure we did save to the new URI
-        self.failUnless(mtime2 < os.path.getmtime(path2))
-
-        # unlink any existing project files
-        try:
-            os.unlink(path)
-            os.unlink(path2)
-        except OSError:
-            pass
-
-    def testBackupProject(self):
-        uri = "file://" + os.path.abspath("testproject.xptv")
-
-        # Create and save the project
-        self.manager.newBlankProject()
-        self.manager.saveProject(self.manager.current, uri, True)
-
-        # Save the backup
-        self.manager._saveBackupCb(self.manager.current, uri)
-        backup_uri = self.manager._makeBackupURI(uri)
-        self.failUnless(uri_is_reachable(uri))
-        self.failUnless(uri_is_reachable(backup_uri))
-
-        # When closing it should clean the backup
-        self.manager.closeRunningProject()
-        self.failUnless(not uri_is_reachable(backup_uri))
-
-        # unlink any existing project files
-        try:
-            os.unlink(uri)
-            os.unlink(backup_uri)
-        except OSError:
-            pass
+
+####
+#
+# FIXME reimplement after GES port
+#
+####
+
+#from unittest import TestCase
+
+#from pitivi.projectmanager import ProjectManager
+#from pitivi.formatters.base import Formatter, \
+        #FormatterError, FormatterLoadError
+#import os
+#import gst
+#from pitivi.utils import uri_is_reachable
+#import time
+
+
+#class MockProject(object):
+    #settings = None
+    #format = None
+    #uri = None
+    #has_mods = True
+
+    #def hasUnsavedModifications(self):
+        #return self.has_mods
+
+    #def release(self):
+        #pass
+
+    #def disconnect_by_function(self, ignored):
+        #pass
+
+
+#class ProjectManagerListener(object):
+    #def __init__(self, manager):
+        #self.manager = manager
+        #self.connectToProjectManager(self.manager)
+        #self._reset()
+
+    #def _reset(self):
+        #self.signals = []
+
+    #def connectToProjectManager(self, manager):
+        #for signal in ("new-project-loading", "new-project-loaded",
+                #"new-project-created", "new-project-failed", "missing-uri",
+                #"closing-project", "project-closed"):
+            #self.manager.connect(signal, self._recordSignal, signal)
+
+    #def _recordSignal(self, *args):
+        #signal = args[-1]
+        #args = args[1:-1]
+        #self.signals.append((signal, args))
+
+        #return True
+
+
+#class TestProjectManager(TestCase):
+    #def setUp(self):
+        #self.manager = ProjectManager()
+        #self.listener = ProjectManagerListener(self.manager)
+        #self.signals = self.listener.signals
+
+    #def testLoadProjectFailedUnknownFormat(self):
+        #"""
+        #Check that new-project-failed is emitted when we don't have a suitable
+        #formatter.
+        #"""
+        #uri = "file:///Untitled.meh"
+        #self.manager.loadProject(uri)
+        #self.failUnlessEqual(len(self.signals), 2)
+
+        ## loading
+        #name, args = self.signals[0]
+        #self.failUnlessEqual(args[0], uri)
+
+        ## failed
+        #name, args = self.signals[1]
+        #self.failUnlessEqual(name, "new-project-failed")
+        #signalUri, exception = args
+        #self.failUnlessEqual(uri, signalUri)
+        #self.failUnless(isinstance(exception, FormatterLoadError))
+
+    #def testLoadProjectFailedCloseCurrent(self):
+        #"""
+        #Check that new-project-failed is emited if we can't close the current
+        #project instance.
+        #"""
+        #state = {"tried-close": False}
+
+        #def close():
+            #state["tried-close"] = True
+            #return False
+        #self.manager.closeRunningProject = close
+
+        #uri = "file:///Untitled.xptv"
+        #self.manager.loadProject(uri)
+        #self.failUnlessEqual(len(self.signals), 2)
+
+        ## loading
+        #name, args = self.signals[0]
+        #self.failUnlessEqual(args[0], uri)
+
+        ## failed
+        #name, args = self.signals[1]
+        #self.failUnlessEqual(name, "new-project-failed")
+        #signalUri, exception = args
+        #self.failUnlessEqual(uri, signalUri)
+        #self.failUnless(isinstance(exception, FormatterLoadError))
+        #self.failUnless(state["tried-close"])
+
+    #def testLoadProjectFailedProxyFormatter(self):
+        #"""
+        #Check that new-project-failed is proxied when a formatter emits it.
+        #"""
+        #class FailFormatter(Formatter):
+            #def _validateUri(self, uri):
+                #pass
+
+            #def _loadProject(self, location, project=None):
+                #raise FormatterError()
+        #self.manager._getFormatterForUri = lambda uri: FailFormatter([])
+
+        #uri = "file:///Untitled.xptv"
+        #self.manager.loadProject(uri)
+        #self.failUnlessEqual(len(self.signals), 3)
+
+        ## loading
+        #name, args = self.signals[0]
+        #self.failUnlessEqual(name, "new-project-loading")
+        #self.failUnlessEqual(args[0], uri)
+
+        ## created
+        #name, args = self.signals[1]
+        #self.failUnlessEqual(name, "new-project-created")
+
+        ## failed
+        #name, args = self.signals[2]
+        #self.failUnlessEqual(name, "new-project-failed")
+        #signalUri, exception = args
+        #self.failUnlessEqual(uri, signalUri)
+        #self.failUnless(isinstance(exception, FormatterError))
+
+    #def testLoadProjectMissingUri(self):
+        #class MissingUriFormatter(Formatter):
+            #def _validateUri(self, uri):
+                #pass
+
+            #def _loadProject(self, location, project):
+                #self._finishLoadingProject(project)
+
+            #def _getSources(self):
+                ## this will emit missing-uri
+                #self.validateSourceURI("file:///icantpossiblyexist", None)
+                #return []
+
+            #def _fillTimeline(self):
+                #pass
+        #self.manager._getFormatterForUri = lambda uri: MissingUriFormatter([])
+
+        #uri = "file:///Untitled.xptv"
+        #self.manager.loadProject(uri)
+        #self.failUnlessEqual(len(self.signals), 4)
+
+        ## loading
+        #name, args = self.signals[0]
+        #self.failUnlessEqual(name, "new-project-loading")
+        #self.failUnlessEqual(args[0], uri)
+
+        #name, args = self.signals[1]
+        #self.failUnlessEqual(name, "new-project-created")
+        #self.failUnlessEqual(args[0].uri, uri)
+
+        ## failed
+        #name, args = self.signals[2]
+        #self.failUnlessEqual(name, "missing-uri")
+        #formatter, signalUri, unused_factory = args
+        #self.failUnlessEqual(signalUri, "file:///icantpossiblyexist")
+
+    #def testLoadProjectLoaded(self):
+        #class EmptyFormatter(Formatter):
+            #def _validateUri(self, uri):
+                #pass
+
+            #def _loadProject(self, location, project):
+                #self._finishLoadingProject(project)
+
+            #def _getSources(self):
+                #return []
+
+            #def _fillTimeline(self):
+                #pass
+        #self.manager._getFormatterForUri = lambda uri: EmptyFormatter([])
+
+        #uri = "file:///Untitled.xptv"
+        #self.manager.loadProject(uri)
+        #self.failUnlessEqual(len(self.signals), 3)
+
+        ## loading
+        #name, args = self.signals[0]
+        #self.failUnlessEqual(args[0], uri)
+
+        #name, args = self.signals[1]
+        #self.failUnlessEqual(name, "new-project-created")
+        #project = args[0]
+        #self.failUnlessEqual(uri, project.uri)
+
+        #name, args = self.signals[2]
+        #self.failUnlessEqual(name, "new-project-loaded")
+        #project = args[0]
+        #self.failUnlessEqual(uri, project.uri)
+
+    #def testCloseRunningProjectNoProject(self):
+        #self.failUnless(self.manager.closeRunningProject())
+        #self.failIf(self.signals)
+
+    #def testCloseRunningProjectRefuseFromSignal(self):
+        #def closing(manager, project):
+            #return False
+
+        #self.manager.current = MockProject()
+        #self.manager.current.has_mods = False
+        #self.manager.current.uri = "file:///ciao"
+        #self.manager.connect("closing-project", closing)
+
+        #self.failIf(self.manager.closeRunningProject())
+        #self.failUnlessEqual(len(self.signals), 1)
+        #name, args = self.signals[0]
+        #self.failUnlessEqual(name, "closing-project")
+        #project = args[0]
+        #self.failUnless(project is self.manager.current)
+
+    #def testCloseRunningProject(self):
+        #current = self.manager.current = MockProject()
+        #self.manager.current.has_mods = False
+        #self.failUnless(self.manager.closeRunningProject())
+        #self.failUnlessEqual(len(self.signals), 2)
+
+        #name, args = self.signals[0]
+        #self.failUnlessEqual(name, "closing-project")
+        #project = args[0]
+        #self.failUnless(project is current)
+
+        #name, args = self.signals[1]
+        #self.failUnlessEqual(name, "project-closed")
+        #project = args[0]
+        #self.failUnless(project is current)
+
+        #self.failUnlessEqual(self.manager.current, None)
+
+    #def testNewBlankProjectCantCloseCurrent(self):
+        #def closing(manager, project):
+            #return False
+
+        #self.manager.current = MockProject()
+        #self.manager.current.has_mods = False
+        #self.manager.current.uri = "file:///ciao"
+        #self.manager.connect("closing-project", closing)
+        #self.failIf(self.manager.newBlankProject())
+        #self.failUnlessEqual(len(self.signals), 1)
+        #signal, args = self.signals[0]
+        #self.failUnlessEqual(signal, "closing-project")
+
+    #def testNewBlankProject(self):
+        #self.failUnless(self.manager.newBlankProject())
+        #self.failUnlessEqual(len(self.signals), 3)
+
+        #name, args = self.signals[0]
+        #self.failUnlessEqual(name, "new-project-loading")
+        #uri = args[0]
+        #self.failUnlessEqual(uri, None)
+
+        #name, args = self.signals[1]
+        #self.failUnlessEqual(name, "new-project-created")
+        #project = args[0]
+        #self.failUnlessEqual(uri, project.uri)
+
+        #name, args = self.signals[2]
+        #self.failUnlessEqual(name, "new-project-loaded")
+        #project = args[0]
+        #self.failUnless(project is self.manager.current)
+
+    #def testSaveProject(self):
+        #uri = "file://" + os.path.abspath("testproject.xptv")
+        #uri2 = "file://" + os.path.abspath("testproject2.xptv")
+        #path = gst.uri_get_location(uri)
+        #path2 = gst.uri_get_location(uri2)
+
+        ## unlink any existing project files
+        #try:
+            #os.unlink(path)
+            #os.unlink(path2)
+        #except OSError:
+            #pass
+
+        ## save a project
+        #self.failUnless(self.manager.newBlankProject())
+        #self.failUnless(self.manager.saveProject(
+            #self.manager.current, uri, True))
+        #self.failUnless(uri_is_reachable(uri))
+
+        ## wait a bit
+        #time.sleep(1.0)
+
+        ## save project under new path
+        #self.failUnless(self.manager.saveProject(
+            #self.manager.current, uri2, True))
+        #self.failUnless(uri_is_reachable(uri2))
+
+        ## make sure the old path and the new path have different mtime
+        #mtime = os.path.getmtime(path)
+        #mtime2 = os.path.getmtime(path2)
+        #self.failUnless(mtime < mtime2)
+
+        ## wait a bit more
+        #time.sleep(1.0)
+
+        ## save project again under new path (by omitting uri arg)
+        #self.failUnless(self.manager.saveProject(
+            #self.manager.current, overwrite=True))
+
+        ## regression test for bug 594396
+        ## make sure we didn't save to the old URI
+        #self.failUnlessEqual(mtime, os.path.getmtime(path))
+        ## make sure we did save to the new URI
+        #self.failUnless(mtime2 < os.path.getmtime(path2))
+
+        ## unlink any existing project files
+        #try:
+            #os.unlink(path)
+            #os.unlink(path2)
+        #except OSError:
+            #pass
+
+    #def testBackupProject(self):
+        #uri = "file://" + os.path.abspath("testproject.xptv")
+
+        ## Create and save the project
+        #self.manager.newBlankProject()
+        #self.manager.saveProject(self.manager.current, uri, True)
+
+        ## Save the backup
+        #self.manager._saveBackupCb(self.manager.current, uri)
+        #backup_uri = self.manager._makeBackupURI(uri)
+        #self.failUnless(uri_is_reachable(uri))
+        #self.failUnless(uri_is_reachable(backup_uri))
+
+        ## When closing it should clean the backup
+        #self.manager.closeRunningProject()
+        #self.failUnless(not uri_is_reachable(backup_uri))
+
+        ## unlink any existing project files
+        #try:
+            #os.unlink(uri)
+            #os.unlink(backup_uri)
+        #except OSError:
+            #pass
diff --git a/tests/test_timeline_undo.py b/tests/test_timeline_undo.py
index d1da484..e3f3c7d 100644
--- a/tests/test_timeline_undo.py
+++ b/tests/test_timeline_undo.py
@@ -19,274 +19,280 @@
 # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 # Boston, MA 02110-1301, USA.
 
-from unittest import TestCase
-
-import gst
-
-from pitivi.pipeline import Pipeline
-from pitivi.timeline.timeline import Timeline, TimelineObject, SELECT_ADD
-from pitivi.timeline.track import Track, SourceTrackObject, TrackEffect
-from pitivi.factories.test import VideoTestSourceFactory, TestEffectFactory
-from pitivi.stream import VideoStream
-from pitivi.timeline.timeline_undo import TimelineLogObserver, \
-        TimelineObjectAdded, TimelineObjectRemoved, \
-        TimelineObjectPropertyChanged, TrackEffectAdded
-from pitivi.undo import UndoableActionLog
-
-
-class TestTimelineLogObserver(TimelineLogObserver):
-    def _connectToTimeline(self, timeline):
-        TimelineLogObserver._connectToTimeline(self, timeline)
-        timeline.connected = True
-
-    def _disconnectFromTimeline(self, timeline):
-        TimelineLogObserver._disconnectFromTimeline(self, timeline)
-        timeline.connected = False
-
-    def _connectToTimelineObject(self, timeline_object):
-        TimelineLogObserver._connectToTimelineObject(self, timeline_object)
-        timeline_object.connected = True
-
-    def _disconnectFromTimelineObject(self, timeline_object):
-        TimelineLogObserver._disconnectFromTimelineObject(self, timeline_object)
-        timeline_object.connected = False
-
-
-def new_stream():
-    return VideoStream(gst.Caps("video/x-raw-rgb"))
-
-
-def new_source_factory():
-    return VideoTestSourceFactory()
-
-
-class TestTimelineLogObserverConnections(TestCase):
-    def setUp(self):
-        self.action_log = UndoableActionLog()
-        self.observer = TestTimelineLogObserver(self.action_log)
-
-    def testConnectionAndDisconnection(self):
-        timeline = Timeline()
-        stream = new_stream()
-        factory = new_source_factory()
-        track = Track(stream)
-        track_object1 = SourceTrackObject(factory, stream)
-        track.addTrackObject(track_object1)
-        timeline.addTrack(track)
-        timeline_object1 = TimelineObject(factory)
-        timeline_object1.addTrackObject(track_object1)
-        timeline.addTimelineObject(timeline_object1)
-
-        self.observer.startObserving(timeline)
-        self.failUnless(timeline.connected)
-        self.failUnless(timeline_object1.connected)
-
-        timeline.removeTimelineObject(timeline_object1)
-        self.failIf(timeline_object1.connected)
-
-        timeline.addTimelineObject(timeline_object1)
-        self.failUnless(timeline_object1)
-
-        self.observer.stopObserving(timeline)
-        self.failIf(timeline.connected)
-        self.failIf(timeline_object1.connected)
-
-
-class  TestTimelineUndo(TestCase):
-    def setUp(self):
-        self.stream = new_stream()
-        self.factory = new_source_factory()
-        self.effect_factory = TestEffectFactory(self.stream)
-        self.track1 = Track(self.stream)
-        self.track2 = Track(self.stream)
-        self.timeline = Timeline()
-        self.timeline.addTrack(self.track1)
-        self.timeline.addTrack(self.track2)
-        self.track_object1 = SourceTrackObject(self.factory, self.stream)
-        self.track_object2 = SourceTrackObject(self.factory, self.stream)
-        self.track_effect1 = TrackEffect(self.effect_factory, self.stream)
-        self.track_effect2 = TrackEffect(self.effect_factory, self.stream)
-        self.track1.addTrackObject(self.track_object1)
-        self.track2.addTrackObject(self.track_object2)
-        self.timeline_object1 = TimelineObject(self.factory)
-        self.timeline_object1.addTrackObject(self.track_object1)
-        self.timeline_object1.addTrackObject(self.track_object2)
-        self.action_log = UndoableActionLog()
-        self.observer = TestTimelineLogObserver(self.action_log)
-        self.observer.startObserving(self.timeline)
-
-    def testAddTimelineObject(self):
-        stacks = []
-
-        def commitCb(action_log, stack, nested):
-            stacks.append(stack)
-        self.action_log.connect("commit", commitCb)
-
-        self.action_log.begin("add clip")
-        self.timeline.addTimelineObject(self.timeline_object1)
-        self.action_log.commit()
-
-        self.failUnlessEqual(len(stacks), 1)
-        stack = stacks[0]
-        self.failUnlessEqual(len(stack.done_actions), 1)
-        action = stack.done_actions[0]
-        self.failUnless(isinstance(action, TimelineObjectAdded))
-
-        self.failUnless(self.timeline_object1 \
-                in self.timeline.timeline_objects)
-        self.action_log.undo()
-        self.failIf(self.timeline_object1 \
-                in self.timeline.timeline_objects)
-
-        self.action_log.redo()
-        self.failUnless(self.timeline_object1 \
-                in self.timeline.timeline_objects)
-
-    def testRemoveTimelineObject(self):
-        stacks = []
-
-        def commitCb(action_log, stack, nested):
-            stacks.append(stack)
-        self.action_log.connect("commit", commitCb)
-
-        self.timeline.addTimelineObject(self.timeline_object1)
-        self.action_log.begin("remove clip")
-        self.timeline.removeTimelineObject(self.timeline_object1, deep=True)
-        self.action_log.commit()
-
-        self.failUnlessEqual(len(stacks), 1)
-        stack = stacks[0]
-        self.failUnlessEqual(len(stack.done_actions), 1)
-        action = stack.done_actions[0]
-        self.failUnless(isinstance(action, TimelineObjectRemoved))
-
-        self.failIf(self.timeline_object1 \
-                in self.timeline.timeline_objects)
-        self.action_log.undo()
-        self.failUnless(self.timeline_object1 \
-                in self.timeline.timeline_objects)
-
-        self.action_log.redo()
-        self.failIf(self.timeline_object1 \
-                in self.timeline.timeline_objects)
-
-    def testAddEffectToTimelineObject(self):
-        stacks = []
-        pipeline = Pipeline()
-
-        def commitCb(action_log, stack, nested):
-            stacks.append(stack)
-        self.action_log.connect("commit", commitCb)
-        self.observer.pipeline = pipeline
-
-        #FIXME Should I commit it and check there are 2 elements
-        #in the stacks
-        self.timeline.addTimelineObject(self.timeline_object1)
-        self.track1.addTrackObject(self.track_effect1)
-
-        self.action_log.begin("add effect")
-        self.timeline_object1.addTrackObject(self.track_effect1)
-        self.action_log.commit()
-
-        self.failUnlessEqual(len(stacks), 1)
-        stack = stacks[0]
-        self.failUnlessEqual(len(stack.done_actions), 1)
-        action = stack.done_actions[0]
-        self.failUnless(isinstance(action, TrackEffectAdded))
-
-        self.failUnless(self.track_effect1 \
-                in self.timeline_object1.track_objects)
-        self.failUnless(self.track_effect1 \
-                in self.track1.track_objects)
-        self.failUnless(len([effect for effect in \
-                                self.timeline_object1.track_objects
-                                if isinstance(effect, TrackEffect)]) == 1)
-        self.failUnless(len([effect for effect in self.track1.track_objects
-                             if isinstance(effect, TrackEffect)]) == 1)
-
-        self.action_log.undo()
-        self.failIf(self.track_effect1 \
-                in self.timeline_object1.track_objects)
-        self.failIf(self.track_effect1 \
-                in self.track1.track_objects)
-
-        self.action_log.redo()
-        self.failUnless(len([effect for effect in
-                                self.timeline_object1.track_objects
-                                if isinstance(effect, TrackEffect)]) == 1)
-        self.failUnless(len([effect for effect in self.track1.track_objects
-                             if isinstance(effect, TrackEffect)]) == 1)
-
-        self.timeline.removeTimelineObject(self.timeline_object1, deep=True)
-
-    def testTimelineObjectPropertyChange(self):
-        stacks = []
-
-        def commitCb(action_log, stack, nested):
-            stacks.append(stack)
-        self.action_log.connect("commit", commitCb)
-
-        self.timeline_object1.start = 5 * gst.SECOND
-        self.timeline_object1.duration = 20 * gst.SECOND
-        self.timeline.addTimelineObject(self.timeline_object1)
-        self.action_log.begin("modify clip")
-        self.timeline_object1.start = 10 * gst.SECOND
-        self.action_log.commit()
-
-        self.failUnlessEqual(len(stacks), 1)
-        stack = stacks[0]
-        self.failUnlessEqual(len(stack.done_actions), 1)
-        action = stack.done_actions[0]
-        self.failUnless(isinstance(action, TimelineObjectPropertyChanged))
-
-        self.failUnlessEqual(self.timeline_object1.start, 10 * gst.SECOND)
-        self.action_log.undo()
-        self.failUnlessEqual(self.timeline_object1.start, 5 * gst.SECOND)
-        self.action_log.redo()
-        self.failUnlessEqual(self.timeline_object1.start, 10 * gst.SECOND)
-
-        self.timeline_object1.priority = 10
-        self.action_log.begin("priority change")
-        self.timeline_object1.priority = 20
-        self.action_log.commit()
-
-        self.failUnlessEqual(self.timeline_object1.priority, 20)
-        self.action_log.undo()
-        self.failUnlessEqual(self.timeline_object1.priority, 10)
-        self.action_log.redo()
-        self.failUnlessEqual(self.timeline_object1.priority, 20)
-
-    def testUngroup(self):
-        self.timeline_object1.start = 5 * gst.SECOND
-        self.timeline_object1.duration = 20 * gst.SECOND
-
-        self.timeline.addTimelineObject(self.timeline_object1)
-        self.timeline.setSelectionToObj(self.track_object1, SELECT_ADD)
-
-        self.failUnlessEqual(len(self.timeline.timeline_objects), 1)
-        self.failUnlessEqual(self.timeline.timeline_objects[0].start,
-                5 * gst.SECOND)
-        self.failUnlessEqual(self.timeline.timeline_objects[0].duration,
-                20 * gst.SECOND)
-
-        self.action_log.begin("ungroup")
-        self.timeline.ungroupSelection()
-        self.action_log.commit()
-
-        self.failUnlessEqual(len(self.timeline.timeline_objects), 2)
-        self.failUnlessEqual(self.timeline.timeline_objects[0].start,
-                5 * gst.SECOND)
-        self.failUnlessEqual(self.timeline.timeline_objects[0].duration,
-                20 * gst.SECOND)
-        self.failUnlessEqual(self.timeline.timeline_objects[1].start,
-                5 * gst.SECOND)
-        self.failUnlessEqual(self.timeline.timeline_objects[1].duration,
-                20 * gst.SECOND)
-
-        self.action_log.undo()
-
-        self.failUnlessEqual(len(self.timeline.timeline_objects), 1)
-        self.failUnlessEqual(self.timeline.timeline_objects[0].start,
-                5 * gst.SECOND)
-        self.failUnlessEqual(self.timeline.timeline_objects[0].duration,
-                20 * gst.SECOND)
+
+####
+#
+# FIXME: This should all be reimplemented after the port to GES
+#
+####
+
+#from unittest import TestCase
+
+#import gst
+
+#from pitivi.pipeline import Pipeline
+#from pitivi.timeline.timeline import Timeline, TimelineObject, SELECT_ADD
+#from pitivi.timeline.track import Track, SourceTrackObject, TrackEffect
+#from pitivi.factories.test import VideoTestSourceFactory, TestEffectFactory
+#from pitivi.stream import VideoStream
+#from pitivi.timeline.timeline_undo import TimelineLogObserver, \
+        #TimelineObjectAdded, TimelineObjectRemoved, \
+        #TimelineObjectPropertyChanged, TrackEffectAdded
+#from pitivi.undo import UndoableActionLog
+
+#class TestTimelineLogObserver(TimelineLogObserver):
+    #def _connectToTimeline(self, timeline):
+        #TimelineLogObserver._connectToTimeline(self, timeline)
+        #timeline.connected = True
+
+    #def _disconnectFromTimeline(self, timeline):
+        #TimelineLogObserver._disconnectFromTimeline(self, timeline)
+        #timeline.connected = False
+
+    #def _connectToTimelineObject(self, timeline_object):
+        #TimelineLogObserver._connectToTimelineObject(self, timeline_object)
+        #timeline_object.connected = True
+
+    #def _disconnectFromTimelineObject(self, timeline_object):
+        #TimelineLogObserver._disconnectFromTimelineObject(self, timeline_object)
+        #timeline_object.connected = False
+
+
+#def new_stream():
+    #return VideoStream(gst.Caps("video/x-raw-rgb"))
+
+
+#def new_source_factory():
+    #return VideoTestSourceFactory()
+
+
+#class TestTimelineLogObserverConnections(TestCase):
+    #def setUp(self):
+        #self.action_log = UndoableActionLog()
+        #self.observer = TestTimelineLogObserver(self.action_log)
+
+    #def testConnectionAndDisconnection(self):
+        #timeline = Timeline()
+        #stream = new_stream()
+        #factory = new_source_factory()
+        #track = Track(stream)
+        #track_object1 = SourceTrackObject(factory, stream)
+        #track.addTrackObject(track_object1)
+        #timeline.addTrack(track)
+        #timeline_object1 = TimelineObject(factory)
+        #timeline_object1.addTrackObject(track_object1)
+        #timeline.addTimelineObject(timeline_object1)
+
+        #self.observer.startObserving(timeline)
+        #self.failUnless(timeline.connected)
+        #self.failUnless(timeline_object1.connected)
+
+        #timeline.removeTimelineObject(timeline_object1)
+        #self.failIf(timeline_object1.connected)
+
+        #timeline.addTimelineObject(timeline_object1)
+        #self.failUnless(timeline_object1)
+
+        #self.observer.stopObserving(timeline)
+        #self.failIf(timeline.connected)
+        #self.failIf(timeline_object1.connected)
+
+
+#class  TestTimelineUndo(TestCase):
+    #def setUp(self):
+        #self.stream = new_stream()
+        #self.factory = new_source_factory()
+        #self.effect_factory = TestEffectFactory(self.stream)
+        #self.track1 = Track(self.stream)
+        #self.track2 = Track(self.stream)
+        #self.timeline = Timeline()
+        #self.timeline.addTrack(self.track1)
+        #self.timeline.addTrack(self.track2)
+        #self.track_object1 = SourceTrackObject(self.factory, self.stream)
+        #self.track_object2 = SourceTrackObject(self.factory, self.stream)
+        #self.track_effect1 = TrackEffect(self.effect_factory, self.stream)
+        #self.track_effect2 = TrackEffect(self.effect_factory, self.stream)
+        #self.track1.addTrackObject(self.track_object1)
+        #self.track2.addTrackObject(self.track_object2)
+        #self.timeline_object1 = TimelineObject(self.factory)
+        #self.timeline_object1.addTrackObject(self.track_object1)
+        #self.timeline_object1.addTrackObject(self.track_object2)
+        #self.action_log = UndoableActionLog()
+        #self.observer = TestTimelineLogObserver(self.action_log)
+        #self.observer.startObserving(self.timeline)
+
+    #def testAddTimelineObject(self):
+        #stacks = []
+
+        #def commitCb(action_log, stack, nested):
+            #stacks.append(stack)
+        #self.action_log.connect("commit", commitCb)
+
+        #self.action_log.begin("add clip")
+        #self.timeline.addTimelineObject(self.timeline_object1)
+        #self.action_log.commit()
+
+        #self.failUnlessEqual(len(stacks), 1)
+        #stack = stacks[0]
+        #self.failUnlessEqual(len(stack.done_actions), 1)
+        #action = stack.done_actions[0]
+        #self.failUnless(isinstance(action, TimelineObjectAdded))
+
+        #self.failUnless(self.timeline_object1 \
+                #in self.timeline.timeline_objects)
+        #self.action_log.undo()
+        #self.failIf(self.timeline_object1 \
+                #in self.timeline.timeline_objects)
+
+        #self.action_log.redo()
+        #self.failUnless(self.timeline_object1 \
+                #in self.timeline.timeline_objects)
+
+    #def testRemoveTimelineObject(self):
+        #stacks = []
+
+        #def commitCb(action_log, stack, nested):
+            #stacks.append(stack)
+        #self.action_log.connect("commit", commitCb)
+
+        #self.timeline.addTimelineObject(self.timeline_object1)
+        #self.action_log.begin("remove clip")
+        #self.timeline.removeTimelineObject(self.timeline_object1, deep=True)
+        #self.action_log.commit()
+
+        #self.failUnlessEqual(len(stacks), 1)
+        #stack = stacks[0]
+        #self.failUnlessEqual(len(stack.done_actions), 1)
+        #action = stack.done_actions[0]
+        #self.failUnless(isinstance(action, TimelineObjectRemoved))
+
+        #self.failIf(self.timeline_object1 \
+                #in self.timeline.timeline_objects)
+        #self.action_log.undo()
+        #self.failUnless(self.timeline_object1 \
+                #in self.timeline.timeline_objects)
+
+        #self.action_log.redo()
+        #self.failIf(self.timeline_object1 \
+                #in self.timeline.timeline_objects)
+
+    #def testAddEffectToTimelineObject(self):
+        #stacks = []
+        #pipeline = Pipeline()
+
+        #def commitCb(action_log, stack, nested):
+            #stacks.append(stack)
+        #self.action_log.connect("commit", commitCb)
+        #self.observer.pipeline = pipeline
+
+        ##FIXME Should I commit it and check there are 2 elements
+        ##in the stacks
+        #self.timeline.addTimelineObject(self.timeline_object1)
+        #self.track1.addTrackObject(self.track_effect1)
+
+        #self.action_log.begin("add effect")
+        #self.timeline_object1.addTrackObject(self.track_effect1)
+        #self.action_log.commit()
+
+        #self.failUnlessEqual(len(stacks), 1)
+        #stack = stacks[0]
+        #self.failUnlessEqual(len(stack.done_actions), 1)
+        #action = stack.done_actions[0]
+        #self.failUnless(isinstance(action, TrackEffectAdded))
+
+        #self.failUnless(self.track_effect1 \
+                #in self.timeline_object1.track_objects)
+        #self.failUnless(self.track_effect1 \
+                #in self.track1.track_objects)
+        #self.failUnless(len([effect for effect in \
+                                #self.timeline_object1.track_objects
+                                #if isinstance(effect, TrackEffect)]) == 1)
+        #self.failUnless(len([effect for effect in self.track1.track_objects
+                             #if isinstance(effect, TrackEffect)]) == 1)
+
+        #self.action_log.undo()
+        #self.failIf(self.track_effect1 \
+                #in self.timeline_object1.track_objects)
+        #self.failIf(self.track_effect1 \
+                #in self.track1.track_objects)
+
+        #self.action_log.redo()
+        #self.failUnless(len([effect for effect in
+                                #self.timeline_object1.track_objects
+                                #if isinstance(effect, TrackEffect)]) == 1)
+        #self.failUnless(len([effect for effect in self.track1.track_objects
+                             #if isinstance(effect, TrackEffect)]) == 1)
+
+        #self.timeline.removeTimelineObject(self.timeline_object1, deep=True)
+
+    #def testTimelineObjectPropertyChange(self):
+        #stacks = []
+
+        #def commitCb(action_log, stack, nested):
+            #stacks.append(stack)
+        #self.action_log.connect("commit", commitCb)
+
+        #self.timeline_object1.start = 5 * gst.SECOND
+        #self.timeline_object1.duration = 20 * gst.SECOND
+        #self.timeline.addTimelineObject(self.timeline_object1)
+        #self.action_log.begin("modify clip")
+        #self.timeline_object1.start = 10 * gst.SECOND
+        #self.action_log.commit()
+
+        #self.failUnlessEqual(len(stacks), 1)
+        #stack = stacks[0]
+        #self.failUnlessEqual(len(stack.done_actions), 1)
+        #action = stack.done_actions[0]
+        #self.failUnless(isinstance(action, TimelineObjectPropertyChanged))
+
+        #self.failUnlessEqual(self.timeline_object1.start, 10 * gst.SECOND)
+        #self.action_log.undo()
+        #self.failUnlessEqual(self.timeline_object1.start, 5 * gst.SECOND)
+        #self.action_log.redo()
+        #self.failUnlessEqual(self.timeline_object1.start, 10 * gst.SECOND)
+
+        #self.timeline_object1.priority = 10
+        #self.action_log.begin("priority change")
+        #self.timeline_object1.priority = 20
+        #self.action_log.commit()
+
+        #self.failUnlessEqual(self.timeline_object1.priority, 20)
+        #self.action_log.undo()
+        #self.failUnlessEqual(self.timeline_object1.priority, 10)
+        #self.action_log.redo()
+        #self.failUnlessEqual(self.timeline_object1.priority, 20)
+
+    #def testUngroup(self):
+        #self.timeline_object1.start = 5 * gst.SECOND
+        #self.timeline_object1.duration = 20 * gst.SECOND
+
+        #self.timeline.addTimelineObject(self.timeline_object1)
+        #self.timeline.setSelectionToObj(self.track_object1, SELECT_ADD)
+
+        #self.failUnlessEqual(len(self.timeline.timeline_objects), 1)
+        #self.failUnlessEqual(self.timeline.timeline_objects[0].start,
+                #5 * gst.SECOND)
+        #self.failUnlessEqual(self.timeline.timeline_objects[0].duration,
+                #20 * gst.SECOND)
+
+        #self.action_log.begin("ungroup")
+        #self.timeline.ungroupSelection()
+        #self.action_log.commit()
+
+        #self.failUnlessEqual(len(self.timeline.timeline_objects), 2)
+        #self.failUnlessEqual(self.timeline.timeline_objects[0].start,
+                #5 * gst.SECOND)
+        #self.failUnlessEqual(self.timeline.timeline_objects[0].duration,
+                #20 * gst.SECOND)
+        #self.failUnlessEqual(self.timeline.timeline_objects[1].start,
+                #5 * gst.SECOND)
+        #self.failUnlessEqual(self.timeline.timeline_objects[1].duration,
+                #20 * gst.SECOND)
+
+        #self.action_log.undo()
+
+        #self.failUnlessEqual(len(self.timeline.timeline_objects), 1)
+        #self.failUnlessEqual(self.timeline.timeline_objects[0].start,
+                #5 * gst.SECOND)
+        #self.failUnlessEqual(self.timeline.timeline_objects[0].duration,
+                #20 * gst.SECOND)



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