[pitivi] tests: Test fields set when a project loads
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] tests: Test fields set when a project loads
- Date: Sat, 30 Apr 2016 16:05:33 +0000 (UTC)
commit 94c6705f60ff41bcb7216c0b1bf28869eefe331e
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Wed Apr 27 17:11:25 2016 +0200
tests: Test fields set when a project loads
Differential Revision: https://phabricator.freedesktop.org/D974
tests/test_project.py | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/tests/test_project.py b/tests/test_project.py
index a09b44a..190dd4e 100644
--- a/tests/test_project.py
+++ b/tests/test_project.py
@@ -122,14 +122,31 @@ class TestProjectManager(TestCase):
mainloop.quit()
result = [False]
- self.manager.connect(
- "missing-uri", missingUriCb, result)
+ self.manager.connect("missing-uri", missingUriCb, result)
with common.created_project_file() as uri:
self.assertTrue(self.manager.loadProject(uri))
mainloop.run()
self.assertTrue(result[0], "missing-uri has not been emitted")
+ def testLoaded(self):
+ mainloop = common.create_main_loop()
+
+ def new_project_loaded_cb(project_manager, project):
+ mainloop.quit()
+
+ self.manager.connect("new-project-loaded", new_project_loaded_cb)
+
+ asset_uri = common.get_sample_uri("flat_colour1_640x480.png")
+ with common.created_project_file(asset_uri=asset_uri) as uri:
+ self.assertTrue(self.manager.loadProject(uri))
+ mainloop.run()
+
+ project = self.manager.current_project
+ self.assertFalse(project.at_least_one_asset_missing)
+ self.assertTrue(project.loaded)
+ self.assertFalse(project.hasUnsavedModifications())
+
def testCloseRunningProjectNoProject(self):
self.assertTrue(self.manager.closeRunningProject())
self.assertFalse(self.signals)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]