[pitivi] tests_: Avoid checking for the latest version
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] tests_: Avoid checking for the latest version
- Date: Wed, 20 Apr 2016 11:55:22 +0000 (UTC)
commit 70ed0ca8ff50e42de8d8dd1c08456bc6fe46d8d6
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Tue Apr 19 23:32:44 2016 +0200
tests_: Avoid checking for the latest version
When running the tests, the Pitivi instances should not check for the
latest version of the app.
Reviewed-by: Thibault Saunier <tsaunier gnome org>
Differential Revision: https://phabricator.freedesktop.org/D927
pitivi/application.py | 6 ++++--
tests/common.py | 6 ++++++
tests/test_project.py | 4 +---
tests/test_undo_project.py | 4 +---
tests/test_undo_timeline.py | 4 +---
5 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/pitivi/application.py b/pitivi/application.py
index 4837686..c9533b5 100644
--- a/pitivi/application.py
+++ b/pitivi/application.py
@@ -134,6 +134,10 @@ class Pitivi(Gtk.Application, Loggable):
loggable.init('PITIVI_DEBUG', enable_color, enable_crack_output)
self.info('starting up')
+ self._setup()
+ self._checkVersion()
+
+ def _setup(self):
self.settings = GlobalSettings()
self.threads = ThreadMaster()
self.effects = EffectsManager()
@@ -149,8 +153,6 @@ class Pitivi(Gtk.Application, Loggable):
self._createActions()
self._syncDoUndo()
- self._checkVersion()
-
def _createActions(self):
self.undo_action = Gio.SimpleAction.new("undo", None)
self.undo_action.connect("activate", self._undoCb)
diff --git a/tests/common.py b/tests/common.py
index dc813f6..1755228 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -78,6 +78,12 @@ def create_project():
return project
+def create_pitivi():
+ app = Pitivi()
+ app._setup()
+ return app
+
+
def create_main_loop():
mainloop = GLib.MainLoop()
timed_out = False
diff --git a/tests/test_project.py b/tests/test_project.py
index cffb970..1a4fdb0 100644
--- a/tests/test_project.py
+++ b/tests/test_project.py
@@ -27,7 +27,6 @@ from unittest import TestCase
from gi.repository import GES
from gi.repository import Gst
-from pitivi.application import Pitivi
from pitivi.project import Project
from pitivi.project import ProjectManager
from pitivi.utils.misc import uri_is_reachable
@@ -340,8 +339,7 @@ class TestProjectLoading(common.TestCase):
os.remove(xges_path)
def test_asset_added_signal(self):
- app = Pitivi()
- app._startupCb(app)
+ app = common.create_pitivi()
self.assertTrue(app.project_manager.newBlankProject())
project = app.project_manager.current_project
diff --git a/tests/test_undo_project.py b/tests/test_undo_project.py
index bc5faa5..5f3dedf 100644
--- a/tests/test_undo_project.py
+++ b/tests/test_undo_project.py
@@ -23,7 +23,6 @@ from unittest import TestCase
from gi.repository import GES
from gi.repository import Gtk
-from pitivi.application import Pitivi
from pitivi.project import ProjectSettingsDialog
from tests import common
@@ -31,8 +30,7 @@ from tests import common
class TestProjectUndo(TestCase):
def setUp(self):
- self.app = Pitivi()
- self.app._startupCb(self.app)
+ self.app = common.create_pitivi()
self.assertTrue(self.app.project_manager.newBlankProject())
self.project = self.app.project_manager.current_project
diff --git a/tests/test_undo_timeline.py b/tests/test_undo_timeline.py
index 79fa8cb..b4c1492 100644
--- a/tests/test_undo_timeline.py
+++ b/tests/test_undo_timeline.py
@@ -26,7 +26,6 @@ from gi.repository import GES
from gi.repository import Gst
from gi.repository import GstController
-from pitivi.application import Pitivi
from pitivi.undo.timeline import ClipAdded
from pitivi.undo.timeline import ClipPropertyChanged
from pitivi.undo.timeline import ClipRemoved
@@ -100,8 +99,7 @@ class TestTimelineLogObserver(TestCase):
class TestTimelineUndo(TestCase):
def setUp(self):
- app = Pitivi()
- app._startupCb(app)
+ app = common.create_pitivi()
app.project_manager.newBlankProject()
self.timeline = app.project_manager.current_project.timeline
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]