def setUp(self): """ Set up the environment for testing bible parse reference """ self.build_settings() Registry.create() Registry().register('service_list', MagicMock()) Registry().register('application', MagicMock()) bible_settings = { 'bibles/proxy name': '', 'bibles/db type': 'sqlite', 'bibles/book name language': LanguageSelection.Bible, 'bibles/verse separator': '', 'bibles/range separator': '', 'bibles/list separator': '', 'bibles/end separator': '', } Settings().extend_default_settings(bible_settings) with patch('openlp.core.common.applocation.Settings') as mocked_class, \ patch('openlp.core.common.AppLocation.get_section_data_path') as mocked_get_section_data_path, \ patch('openlp.core.common.AppLocation.get_files') as mocked_get_files: # GIVEN: A mocked out Settings class and a mocked out AppLocation.get_files() mocked_settings = mocked_class.return_value mocked_settings.contains.return_value = False mocked_get_files.return_value = ["tests.sqlite"] mocked_get_section_data_path.return_value = TEST_RESOURCES_PATH + "/bibles" self.manager = BibleManager(MagicMock())
def __init__(self): super(BiblePlugin, self).__init__('bibles', __default_settings__, BibleMediaItem, BiblesTab) self.weight = -9 self.icon_path = ':/plugins/plugin_bibles.png' self.icon = build_icon(self.icon_path) self.manager = BibleManager(self)
def __init__(self): super(BiblePlugin, self).__init__('bibles', __default_settings__, BibleMediaItem, BiblesTab) self.weight = -9 self.icon_path = UiIcons().bible self.icon = UiIcons().bible self.manager = BibleManager(self) register_endpoint(bibles_endpoint) register_endpoint(api_bibles_endpoint)