def test_invalid_verses_without_validation(self): gospel_library_url = 'gospellibrary://content/scriptures/bofm/1-ne/1?verse=21#p21' ref = ScriptureRef(gospel_library_url=gospel_library_url, validate_verses=False) self.assert_scripture_ref(ref, 'bofm', '1-ne', 1, [(21, 21)]) self.assertEqual(ref.gospel_library_url(), gospel_library_url) gospel_library_url = 'gospellibrary://content/scriptures/bofm/1-ne/1?verse=20-21#p20' ref = ScriptureRef(gospel_library_url=gospel_library_url, validate_verses=False) self.assert_scripture_ref(ref, 'bofm', '1-ne', 1, [(20, 21)]) self.assertEqual(ref.gospel_library_url(), gospel_library_url) gospel_library_url = 'gospellibrary://content/scriptures/bofm/1-ne/1?verse=1,21#p1' ref = ScriptureRef(gospel_library_url=gospel_library_url, validate_verses=False) self.assert_scripture_ref(ref, 'bofm', '1-ne', 1, [(1, 1), (21, 21)]) self.assertEqual(ref.gospel_library_url(), gospel_library_url)
def test_no_book(self): gospel_library_url = 'gospellibrary://content/scriptures/ot' ref = ScriptureRef(gospel_library_url=gospel_library_url) self.assert_scripture_ref(ref, 'ot', None, None, None) self.assertEqual(ref.gospel_library_url(), gospel_library_url)
def test_chapter_ranges(self): gospel_library_url = 'gospellibrary://content/scriptures/bofm/alma/56-57' ref = ScriptureRef(gospel_library_url=gospel_library_url) self.assert_scripture_ref(ref, 'bofm', 'alma', (56, 57)) self.assertEqual(ref.gospel_library_url(), gospel_library_url)
def test_parentheticals(self): gospel_library_url = 'gospellibrary://content/scriptures/dc-testament/dc/76?verse=56-57&context=50-70#p56' ref = ScriptureRef(gospel_library_url=gospel_library_url) self.assert_scripture_ref(ref, 'dc-testament', 'dc', 76, [(56, 57)], (50, 70)) self.assertEqual(ref.gospel_library_url(), gospel_library_url)
def test_discontiguous_verse_ranges(self): gospel_library_url = 'gospellibrary://content/scriptures/ot/isa/40?verse=1-4,6-7,10#p1' ref = ScriptureRef(gospel_library_url=gospel_library_url) self.assert_scripture_ref(ref, 'ot', 'isa', 40, [(1, 4), (6, 7), (10, 10)]) self.assertEqual(ref.gospel_library_url(), gospel_library_url)
def test_discontiguous_single_verses(self): gospel_library_url = 'gospellibrary://content/scriptures/ot/isa/40?verse=1,4#p1' ref = ScriptureRef(gospel_library_url=gospel_library_url) self.assert_scripture_ref(ref, 'ot', 'isa', 40, [(1, 1), (4, 4)]) self.assertEqual(ref.gospel_library_url(), gospel_library_url)
def test_no_verses(self): gospel_library_url = 'gospellibrary://content/scriptures/ot/isa/40' ref = ScriptureRef(gospel_library_url=gospel_library_url) self.assert_scripture_ref(ref, 'ot', 'isa', 40) self.assertEqual(ref.gospel_library_url(), gospel_library_url)
def test_single_verse(self): gospel_library_url = 'gospellibrary://content/scriptures/ot/isa/40?verse=1#p1' ref = ScriptureRef(gospel_library_url=gospel_library_url) self.assert_scripture_ref(ref, 'ot', 'isa', 40, [(1, 1)]) self.assertEqual(ref.gospel_library_url(), gospel_library_url)