From 30278b1a56032e8f49858f0b159e079a64f14db4 Mon Sep 17 00:00:00 2001 From: Felipe Polo-Wood Date: Thu, 24 Oct 2013 22:33:54 -0400 Subject: [PATCH] Fixed compatibility with Ubuntu on the unit tests. --- .../presentations/test_powerpointcontroller.py | 4 ++-- .../presentations/test_powerpointviewercontroller.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py b/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py index dbc210cc8..b93596342 100644 --- a/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py @@ -54,7 +54,7 @@ class TestLibModule(TestCase): # WHEN: We "convert" it to a bool isInstalled = self.ppc.check_available() # THEN: We should get back a True bool - assert isInstalled is True, u'The result should be True' + assert isInstalled is True, 'The result should be True' # add _test to the following if necessary def verify_loading_document(self): @@ -68,7 +68,7 @@ class TestLibModule(TestCase): self.doc.load_presentation() result = self.doc.is_loaded() # THEN: result should be true - assert result is True, u'The result should be True' + assert result is True, 'The result should be True' def create_titles_and_notes_test(self): """ diff --git a/tests/functional/openlp_plugins/presentations/test_powerpointviewercontroller.py b/tests/functional/openlp_plugins/presentations/test_powerpointviewercontroller.py index bb7bf3b44..19dc79db8 100644 --- a/tests/functional/openlp_plugins/presentations/test_powerpointviewercontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_powerpointviewercontroller.py @@ -54,7 +54,7 @@ class TestLibModule(TestCase): # WHEN: We "convert" it to a bool isInstalled = self.ppc.check_available() # THEN: We should get back a True bool - assert isInstalled is True, u'The result should be True' + assert isInstalled is True, 'The result should be True' # add _test to the following if necessary to enable test # I don't have powerpointviewer to verify @@ -104,8 +104,10 @@ class TestLibModule(TestCase): """ # GIVEN: mocked PresentationController.save_titles_and_notes and an nonexistent file with patch('builtins.open') as mocked_open, \ - patch('openlp.plugins.presentations.lib.pptviewcontroller.os.path.exists') as mocked_exists: + patch('openlp.plugins.presentations.lib.pptviewcontroller.os.path.exists') as mocked_exists, \ + patch('openlp.plugins.presentations.lib.presentationcontroller.check_directory_exists') as mocked_dir_exists: mocked_exists.return_value = False + mocked_dir_exists.return_value = False self.doc = PptviewDocument(self.ppc,'Idontexist.pptx') self.doc.save_titles_and_notes = MagicMock() # WHEN: reading the titles and notes