forked from openlp/openlp
Migrate new tests to mixins
This commit is contained in:
parent
9cf3428542
commit
86bbc0d66c
@ -29,8 +29,6 @@
|
|||||||
"""
|
"""
|
||||||
Functional tests to test the Bible Manager class and related methods.
|
Functional tests to test the Bible Manager class and related methods.
|
||||||
"""
|
"""
|
||||||
import os
|
|
||||||
from tempfile import mkstemp
|
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
|
|
||||||
from openlp.core.common import Registry, Settings
|
from openlp.core.common import Registry, Settings
|
||||||
@ -38,16 +36,16 @@ from openlp.plugins.bibles.lib import BibleManager, LanguageSelection
|
|||||||
from tests.interfaces import MagicMock, patch
|
from tests.interfaces import MagicMock, patch
|
||||||
|
|
||||||
from tests.utils.constants import TEST_RESOURCES_PATH
|
from tests.utils.constants import TEST_RESOURCES_PATH
|
||||||
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
class TestBibleManager(TestCase):
|
class TestBibleManager(TestCase, TestMixin):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
"""
|
"""
|
||||||
Set up the environment for testing bible queries with 1 Timothy 3
|
Set up the environment for testing bible queries with 1 Timothy 3
|
||||||
"""
|
"""
|
||||||
fd, self.ini_file = mkstemp('.ini')
|
self.build_settings()
|
||||||
Settings().set_filename(self.ini_file)
|
|
||||||
Registry.create()
|
Registry.create()
|
||||||
Registry().register('service_list', MagicMock())
|
Registry().register('service_list', MagicMock())
|
||||||
Registry().register('application', MagicMock())
|
Registry().register('application', MagicMock())
|
||||||
@ -75,7 +73,7 @@ class TestBibleManager(TestCase):
|
|||||||
"""
|
"""
|
||||||
Delete all the C++ objects at the end so that we don't have a segfault
|
Delete all the C++ objects at the end so that we don't have a segfault
|
||||||
"""
|
"""
|
||||||
os.unlink(self.ini_file)
|
self.destroy_settings()
|
||||||
|
|
||||||
def get_books_test(self):
|
def get_books_test(self):
|
||||||
"""
|
"""
|
||||||
|
@ -29,9 +29,6 @@
|
|||||||
"""
|
"""
|
||||||
This module contains tests for the lib submodule of the Bibles plugin.
|
This module contains tests for the lib submodule of the Bibles plugin.
|
||||||
"""
|
"""
|
||||||
import os
|
|
||||||
from tempfile import mkstemp
|
|
||||||
|
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from tests.interfaces import MagicMock, patch
|
from tests.interfaces import MagicMock, patch
|
||||||
|
|
||||||
@ -39,16 +36,16 @@ from openlp.core.common import Registry, Settings
|
|||||||
from openlp.plugins.bibles.lib import BibleManager, parse_reference, LanguageSelection
|
from openlp.plugins.bibles.lib import BibleManager, parse_reference, LanguageSelection
|
||||||
|
|
||||||
from tests.utils.constants import TEST_RESOURCES_PATH
|
from tests.utils.constants import TEST_RESOURCES_PATH
|
||||||
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
class TestBibleManager(TestCase):
|
class TestBibleManager(TestCase, TestMixin):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
"""
|
"""
|
||||||
Set up the environment for testing bible parse reference
|
Set up the environment for testing bible parse reference
|
||||||
"""
|
"""
|
||||||
fd, self.ini_file = mkstemp('.ini')
|
self.build_settings()
|
||||||
Settings().set_filename(self.ini_file)
|
|
||||||
Registry.create()
|
Registry.create()
|
||||||
Registry().register('service_list', MagicMock())
|
Registry().register('service_list', MagicMock())
|
||||||
Registry().register('application', MagicMock())
|
Registry().register('application', MagicMock())
|
||||||
@ -76,7 +73,7 @@ class TestBibleManager(TestCase):
|
|||||||
"""
|
"""
|
||||||
Delete all the C++ objects at the end so that we don't have a segfault
|
Delete all the C++ objects at the end so that we don't have a segfault
|
||||||
"""
|
"""
|
||||||
os.unlink(self.ini_file)
|
self.destroy_settings()
|
||||||
|
|
||||||
def parse_reference_one_test(self):
|
def parse_reference_one_test(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user