def test_get_base_chapter(self): bible = BaseExtractor(file_reading_function=yaml_file_interface.read, file_extension=self.get_test_file_extension(), default_directory=self.get_test_directory(), translation=self.get_test_translation()) text = bible.get_chapter('Ecclesiastes', 11) static_file = '{0}/test_get_base_chapter.txt'.format( self.get_test_directory()) with open(static_file, 'r', encoding='utf-8') as file: eccl = file.read() self.assertEqual(eccl, text, 'Passage is incorrect')
def test_get_base_chapter_list(self): online_bible = WebExtractor(output_as_list=True, show_passage_numbers=False, translation=self.get_test_translation()) bible = BaseExtractor(file_reading_function=yaml_file_interface.read, file_extension=self.get_test_file_extension(), output_as_list=True, show_passage_numbers=False, default_directory=self.get_test_directory(), translation=self.get_test_translation()) text = bible.get_chapter('Ecclesiastes', 11) eccl = online_bible.get_chapter('Ecclesiastes', 11) # Results should be identical between the web and base extractor # Ignoring passage numbers, as the web extractor omits this for the first passage of each chapter self.assertEqual(eccl, text, 'Passage is incorrect')