def test_search_multiple_duplicate_entries(self):
     bible = WebExtractor()
     expected_passage = bible.search('Ecclesiastes 1:17')
     text1 = '\n'.join([expected_passage, expected_passage])
     text2 = bible.search_multiple(
         ['Ecclesiastes 1:17', 'Ecclesiastes 1:17'])
     self.assertEqual(text1, text2, 'Passage is incorrect')
 def test_search_multiple_manual_delimiter(self):
     bible = WebExtractor()
     text1 = '\n'.join(
         [bible.search('Ecclesiastes 1:17'),
          bible.search('Philemon 1:1')])
     text2 = bible.search_multiple(['Ecclesiastes 1:17;Philemon 1:1', ''])
     # While unconventional, this still resolves to a valid search URL
     self.assertEqual(text1, text2, 'Passage is incorrect')
 def test_get_multiple_passage_list_from_string(self):
     bible = WebExtractor(output_as_list=True)
     text = bible.search_multiple(['1 John 1:8 - 9', 'Haggai 1:3'])
     passages = [
         '\u2078 If we claim to be without sin, we deceive ourselves and the truth is not in us. ',
         '\u2079 If we confess our sins, he is faithful and just and will forgive us our sins and purify '
         'us from all unrighteousness.\n',
         '\u00b3 Then the word of the Lord came through the prophet Haggai:'
     ]
     # The last passage of the first set ends with a newline character to denote separation from the other passage
     self.assertEqual(passages, text, 'Passage is incorrect')
 def test_search_multiple_single_invalid_passage(self):
     bible = WebExtractor()
     text1 = bible.search('Ecclesiastes 1:17')
     text2 = bible.search_multiple(['Ecclesiastes 1:17', 'Barnabas 7'])
     # An invalid passage in a multiple passage search is ignored
     self.assertEqual(text1, text2, 'Passage is incorrect')
 def test_search_multiple_single_passage(self):
     bible = WebExtractor()
     text1 = bible.search('Ecclesiastes 1:17')
     text2 = bible.search_multiple(['Ecclesiastes 1:17'])
     # Searching multiple passages with a one-item list should be the same as invoking the search method
     self.assertEqual(text1, text2, 'Passage is incorrect')
 def test_search_multiple(self):
     bible = WebExtractor()
     text1 = bible.search('Ecclesiastes 1:17') + '\n' + bible.search(
         'Philemon 1:1')
     text2 = bible.search_multiple(['Ecclesiastes 1:17', 'Philemon 1:1'])
     self.assertEqual(text1, text2, 'Passage is incorrect')
 def test_get_multiple_passage_list_from_string_one_invalid_passage(self):
     bible = WebExtractor(output_as_list=True)
     text1 = bible.search('Haggai 1:3')
     text2 = bible.search_multiple(['Barnabas 7', 'Haggai 1:3'])
     # An invalid passage would just be ignored
     self.assertEqual(text1, text2, 'Passage is incorrect')
 def test_get_multiple_passage_list_from_string_single(self):
     bible = WebExtractor(output_as_list=True)
     text1 = bible.search('1 John 1:8 - 9')
     text2 = bible.search_multiple(['1 John 1:8 - 9'])
     # Searching multiple passages with a one-item list should be the same as invoking the search method
     self.assertEqual(text1, text2, 'Passage is incorrect')