[pitivi] tests_: Make sure the tests use ProxyingStrategy.NOTHING
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] tests_: Make sure the tests use ProxyingStrategy.NOTHING
- Date: Wed, 20 Apr 2016 11:55:27 +0000 (UTC)
commit cc29d11de145b7dc921e438ac375467c17e4ebb6
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Wed Apr 20 00:46:58 2016 +0200
tests_: Make sure the tests use ProxyingStrategy.NOTHING
Reviewed-by: Thibault Saunier <tsaunier gnome org>
Differential Revision: https://phabricator.freedesktop.org/D928
pitivi/settings.py | 4 +---
tests/common.py | 27 +++++++++++++++------------
2 files changed, 16 insertions(+), 15 deletions(-)
---
diff --git a/pitivi/settings.py b/pitivi/settings.py
index 6195b79..1ed9354 100644
--- a/pitivi/settings.py
+++ b/pitivi/settings.py
@@ -138,9 +138,7 @@ class GlobalSettings(GObject.Object, Loggable):
environment = set()
defaults = {}
- __gsignals__ = {}
-
- def __init__(self, **unused_kwargs):
+ def __init__(self):
GObject.Object.__init__(self)
Loggable.__init__(self)
diff --git a/tests/common.py b/tests/common.py
index 1755228..4470a3c 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -33,6 +33,7 @@ from gi.repository import Gtk
from pitivi import check
from pitivi.application import Pitivi
from pitivi.project import ProjectManager
+from pitivi.settings import GlobalSettings
from pitivi.utils.loggable import Loggable
from pitivi.utils.proxy import ProxyingStrategy
from pitivi.utils.proxy import ProxyManager
@@ -48,24 +49,25 @@ def clean_pitivi_mock(app):
app.proxy_manager = None
-def create_pitivi_mock(proxyingStrategy=ProxyingStrategy.NOTHING,
- numTranscodingJobs=4,
- **additional_settings):
+def __create_settings(proxyingStrategy=ProxyingStrategy.NOTHING,
+ numTranscodingJobs=4,
+ **additional_settings):
+ settings = GlobalSettings()
+ settings.proxyingStrategy = proxyingStrategy
+ settings.numTranscodingJobs = numTranscodingJobs
+ for key, value in additional_settings.items():
+ setattr(settings, key, value)
+ return settings
- def __create_settings():
- settings = mock.MagicMock()
- settings.proxyingStrategy = proxyingStrategy
- settings.numTranscodingJobs = numTranscodingJobs
- for key, value in additional_settings.items():
- setattr(settings, key, value)
- return settings
+
+def create_pitivi_mock(**settings):
app = mock.MagicMock()
app.write_action = mock.MagicMock(spec=Pitivi.write_action)
check.check_requirements()
- app.settings = __create_settings()
+ app.settings = __create_settings(**settings)
app.proxy_manager = ProxyManager(app)
return app
@@ -78,9 +80,10 @@ def create_project():
return project
-def create_pitivi():
+def create_pitivi(**settings):
app = Pitivi()
app._setup()
+ app.settings = __create_settings(**settings)
return app
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]