Fixed compatibility with Ubuntu on the unit tests.

This commit is contained in:
Felipe Polo-Wood 2013-10-24 22:33:54 -04:00
parent 5644e26a85
commit 30278b1a56
2 changed files with 6 additions and 4 deletions

View File

@ -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):
"""

View File

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