def test_get_online_passage_range_with_intermediate_chapters(self): bible = WebExtractor() text1 = bible.get_passage('Daniel', 3, 30) + '\n' + \ bible.get_chapter('Daniel', 4) + '\n' + \ bible.get_passage('Daniel', 5, 1) text2 = bible.get_passage_range('Daniel', 3, 30, 5, 1) # A passage range with intermediate chapters should be the same as manually putting all the passages together self.assertEqual(text1, text2, 'Passage is incorrect')
def test_get_online_passage_range(self): bible = WebExtractor() options = self.get_alternative_interface_options() for option in options: bible.translation = option['translation'] bible.show_passage_numbers = option['show_passage_numbers'] text1 = bible.get_passage( 'Amos', 8, 14) + '\n' + bible.get_passage('Amos', 9, 1) text2 = bible.get_passage_range('Amos', 8, 14, 9, 1) # A passage range should be the same as putting all the passage together with newline separators self.assertEqual(text1, text2, 'Passage is incorrect')
def test_get_passage_list(self): bible = WebExtractor(output_as_list=True) text = bible.get_passage('1 John', 1, 8) john = [ '\u2078 If we claim to be without sin, we deceive ourselves and the truth is not in us.' ] self.assertEqual(john, text, 'Passage is incorrect')
def test_get_online_passage_with_excessive_values(self): bible = WebExtractor() text1 = bible.search('Ecclesiastes 1:1') text2 = bible.get_passage('Ecclesiastes', -1, -1) self.assertEqual(text1, text2, 'Passage is incorrect') # Starting passage is not valid self.assertRaises(InvalidSearchError, bible.get_passage, 'Ecclesiastes', 1000, 1000)
def test_get_online_passage(self): bible = WebExtractor() options = self.get_alternative_interface_options() for option in options: bible.translation = option['translation'] bible.show_passage_numbers = option['show_passage_numbers'] text1 = bible.search('Ecclesiastes 1:17') text2 = bible.get_passage('Ecclesiastes', 1, 17) self.assertEqual(text1, text2, 'Passage is incorrect')