-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
80 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python | ||
import unittest | ||
import yv_suggest.search as yvs | ||
|
||
class SearchIncompleteTestCase(unittest.TestCase): | ||
'''test the searching of incomplete Bible references''' | ||
|
||
def test_incomplete_verse(self): | ||
'''should treat incomplete verse reference as chapter reference''' | ||
results = yvs.get_result_list('psalm 19:') | ||
self.assertEqual(len(results), 1) | ||
self.assertEqual(results[0]['title'], 'Psalm 19') | ||
|
||
def test_incomplete_dot_verse(self): | ||
'''should treat incomplete "dot verse" reference as chapter reference''' | ||
results = yvs.get_result_list('psalm 19.') | ||
self.assertEqual(len(results), 1) | ||
self.assertEqual(results[0]['title'], 'Psalm 19') | ||
|
||
def test_incomplete_verse_range(self): | ||
'''should treat incomplete verse ranges as single-verse references''' | ||
results = yvs.get_result_list('psalm 19.7-') | ||
self.assertEqual(len(results), 1) | ||
self.assertEqual(results[0]['title'], 'Psalm 19.7') | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters