forked from openlp/openlp
Fixed compatibility with Ubuntu on the unit tests.
This commit is contained in:
parent
5644e26a85
commit
30278b1a56
@ -54,7 +54,7 @@ class TestLibModule(TestCase):
|
|||||||
# WHEN: We "convert" it to a bool
|
# WHEN: We "convert" it to a bool
|
||||||
isInstalled = self.ppc.check_available()
|
isInstalled = self.ppc.check_available()
|
||||||
# THEN: We should get back a True bool
|
# 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
|
# add _test to the following if necessary
|
||||||
def verify_loading_document(self):
|
def verify_loading_document(self):
|
||||||
@ -68,7 +68,7 @@ class TestLibModule(TestCase):
|
|||||||
self.doc.load_presentation()
|
self.doc.load_presentation()
|
||||||
result = self.doc.is_loaded()
|
result = self.doc.is_loaded()
|
||||||
# THEN: result should be true
|
# 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):
|
def create_titles_and_notes_test(self):
|
||||||
"""
|
"""
|
||||||
|
@ -54,7 +54,7 @@ class TestLibModule(TestCase):
|
|||||||
# WHEN: We "convert" it to a bool
|
# WHEN: We "convert" it to a bool
|
||||||
isInstalled = self.ppc.check_available()
|
isInstalled = self.ppc.check_available()
|
||||||
# THEN: We should get back a True bool
|
# 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
|
# add _test to the following if necessary to enable test
|
||||||
# I don't have powerpointviewer to verify
|
# 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
|
# GIVEN: mocked PresentationController.save_titles_and_notes and an nonexistent file
|
||||||
with patch('builtins.open') as mocked_open, \
|
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_exists.return_value = False
|
||||||
|
mocked_dir_exists.return_value = False
|
||||||
self.doc = PptviewDocument(self.ppc,'Idontexist.pptx')
|
self.doc = PptviewDocument(self.ppc,'Idontexist.pptx')
|
||||||
self.doc.save_titles_and_notes = MagicMock()
|
self.doc.save_titles_and_notes = MagicMock()
|
||||||
# WHEN: reading the titles and notes
|
# WHEN: reading the titles and notes
|
||||||
|
Loading…
Reference in New Issue
Block a user