コード例 #1
0
 def test_get_base_passages(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_passages('Ecclesiastes', 2, 24, 25)
     self.assertEqual(
         '\u00b2\u2074 There is nothing better for a man than that he should eat and drink, and '
         'make his soul enjoy good in his labor. This also I saw, that it is from the '
         'hand of God. '
         '\u00b2\u2075 For who can eat, or who can have enjoyment, more than I?',
         text, 'Passage is incorrect')
コード例 #2
0
 def test_get_base_passages_list(self):
     bible = BaseExtractor(file_reading_function=yaml_file_interface.read,
                           file_extension=self.get_test_file_extension(),
                           output_as_list=True,
                           default_directory=self.get_test_directory(),
                           translation=self.get_test_translation())
     text = bible.get_passages('1 John', 1, 8, 9)
     john = [
         '\u2078 If we say that we have no sin, we deceive ourselves, and the truth is not in us. ',
         '\u2079 If we confess our sins, he is faithful and righteous to forgive us the sins, '
         'and to cleanse us from all unrighteousness. '
     ]
     self.assertEqual(john, text, 'Passage is incorrect')