Fixed and verified test on Ubuntu/Impress

This commit is contained in:
Felipe Polo-Wood 2013-10-19 23:25:07 -04:00
parent f2a2468e01
commit d4d572bf80
2 changed files with 10 additions and 7 deletions

View File

@ -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()

View File

@ -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'
assert len(titles)==5, 'There should be five titles'
assert len(notes)==5, 'Theres should be five notes'