From d4d572bf8034741063c8dfdb8e54e0309d74c779 Mon Sep 17 00:00:00 2001 From: Felipe Polo-Wood Date: Sat, 19 Oct 2013 23:25:07 -0400 Subject: [PATCH] Fixed and verified test on Ubuntu/Impress --- .../plugins/presentations/lib/impresscontroller.py | 5 ++++- .../presentations/test_impresscontroller.py | 12 ++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index bad33d4c1..cb2cad141 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -249,7 +249,10 @@ class ImpressDocument(PresentationDocument): window = self.document.getCurrentController().getFrame().getContainerWindow() window.setVisible(False) self.presentation = self.document.getPresentation() - self.presentation.Display = ScreenList().current['number'] + 1 + try: + self.presentation.Display = ScreenList().current['number'] + 1 + except: + log.debug('Unable to load the current display') self.control = None self.create_thumbnails() self.create_titles_and_notes() diff --git a/tests/functional/openlp_plugins/presentations/test_impresscontroller.py b/tests/functional/openlp_plugins/presentations/test_impresscontroller.py index 82ff71270..93bf4d58d 100644 --- a/tests/functional/openlp_plugins/presentations/test_impresscontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_impresscontroller.py @@ -56,11 +56,11 @@ 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 # I don't have Impress to verify - def verify_loading_document(self): + def verify_loading_document_test(self): """ Test loading a document """ @@ -71,7 +71,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 verify_titles_test(self): """ @@ -80,6 +80,7 @@ class TestLibModule(TestCase): # GIVEN: self.doc = ImpressDocument(self.ppc,self.file_name) self.doc.load_presentation() + #assert self.doc.is_loaded(), 'The document should have loaded' self.doc.create_titles_and_notes() #self.doc.load_presentation() # WHEN reading the titles and notes @@ -87,6 +88,5 @@ class TestLibModule(TestCase): print("titles: ".join(titles)) print("notes: ".join(notes)) # THEN there should be exactly 5 titles and 5 notes - assert len(titles)==5, u'There should be five titles' - assert len(notes)==5, u'Theres should be five notes' - \ No newline at end of file + assert len(titles)==5, 'There should be five titles' + assert len(notes)==5, 'Theres should be five notes' \ No newline at end of file