[pitivi] tests: Don't save and then overwrite the file
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] tests: Don't save and then overwrite the file
- Date: Sun, 6 Oct 2019 23:37:51 +0000 (UTC)
commit eeb150788c4c403d06c71a1c07a86908b3e52e92
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Fri Aug 16 16:33:36 2019 +0200
tests: Don't save and then overwrite the file
tests/common.py | 3 +--
tests/test_mediafilespreviewer.py | 2 +-
tests/test_project.py | 6 +++---
3 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/tests/common.py b/tests/common.py
index 9da25bf2..a6c6b730 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -262,10 +262,9 @@ class TestCase(unittest.TestCase, Loggable):
self._result = result
unittest.TestCase.run(self, result)
- def create_project_file_from_xges(self, app, xges):
+ def create_project_file_from_xges(self, xges):
unused, xges_path = tempfile.mkstemp(suffix=".xges")
proj_uri = Gst.filename_to_uri(os.path.abspath(xges_path))
- app.project_manager.saveProject(uri=proj_uri)
with open(xges_path, "w") as f:
f.write(xges)
diff --git a/tests/test_mediafilespreviewer.py b/tests/test_mediafilespreviewer.py
index 74a909f4..b7be02ad 100644
--- a/tests/test_mediafilespreviewer.py
+++ b/tests/test_mediafilespreviewer.py
@@ -37,7 +37,7 @@ class PreviewWidgetTest(common.TestCase):
FCpreviewWidth=640,
FCpreviewHeight=480)
- proj_uri = self.create_project_file_from_xges(app, """<ges version='0.3'>
+ proj_uri = self.create_project_file_from_xges("""<ges version='0.3'>
<project properties='properties;' metadatas='metadatas;'>
<ressources>
<asset id='file://this/is/a/moved/asset.mp4' extractable-type-name='GESUriClip'
diff --git a/tests/test_project.py b/tests/test_project.py
index d056de8f..5de9ed7e 100644
--- a/tests/test_project.py
+++ b/tests/test_project.py
@@ -360,7 +360,7 @@ class TestProjectLoading(common.TestCase):
mainloop = common.create_main_loop()
- proj_uri = self.create_project_file_from_xges(app, PROJECT_STR)
+ proj_uri = self.create_project_file_from_xges(PROJECT_STR)
def closing_project_cb(*args, **kwargs):
# Do not ask whether to save project on closing.
@@ -451,7 +451,7 @@ class TestProjectLoading(common.TestCase):
"""Loads a project with moved asset."""
app = common.create_pitivi(proxyingStrategy=ProxyingStrategy.NOTHING)
- proj_uri = self.create_project_file_from_xges(app, """<ges version='0.3'>
+ proj_uri = self.create_project_file_from_xges("""<ges version='0.3'>
<project properties='properties;' metadatas='metadatas;'>
<ressources>
<asset id='file://this/is/a/moved/asset.mp4' extractable-type-name='GESUriClip'
@@ -493,7 +493,7 @@ class TestProjectLoading(common.TestCase):
app = common.create_pitivi(proxyingStrategy=ProxyingStrategy.ALL)
app.proxy_manager.connect("proxy-ready", proxy_ready_cb)
- proj_uri = self.create_project_file_from_xges(app, """<ges version='0.3'>
+ proj_uri = self.create_project_file_from_xges("""<ges version='0.3'>
<project properties='properties;' metadatas='metadatas, name=(string)"New\ Project",
author=(string)Unknown, render-scale=(double)100, format-version=(string)0.3;'>
<ressources>
<asset id='file:///nop/1sec_simpsons_trailer.mp4' extractable-type-name='GESUriClip'
properties='properties, supported-formats=(int)6, duration=(guint64)1228000000;' metadatas='metadatas,
audio-codec=(string)"MPEG-4\ AAC\ audio", maximum-bitrate=(uint)130625, bitrate=(uint)130625,
datetime=(datetime)2007-02-19T05:03:04Z, encoder=(string)Lavf54.6.100, container-format=(string)"ISO\
MP4/M4A", video-codec=(string)"H.264\ /\ AVC", file-size=(guint64)232417;'
proxy-id='file:///nop/1sec_simpsons_trailer.mp4.232417.proxy.mkv' />
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]