Skip to content

Commit

Permalink
Fix get validation pattern, and update Hebrew test metod.
Browse files Browse the repository at this point in the history
  • Loading branch information
Llewellynvdm committed Dec 11, 2023
1 parent 37ab058 commit bc5d171
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="getbible",
version="1.1.1",
version="1.1.2",
author="Llewellyn van der Merwe",
author_email="[email protected]",
description="A Python package to retrieving Bible references with ease.",
Expand Down
2 changes: 1 addition & 1 deletion src/getbible/getbible.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, repo_path: str = "https://api.getbible.net", version: str = '
self.__chapters_cache = {}
self.__start_cache_reset_thread()
# Pattern to check valid translations names
self.__pattern = re.compile(r'^[a-zA-Z0-9]{1,30}$')
self.__pattern = re.compile(r'[a-zA-Z0-9]{1,30}')
# Determine if the repository path is a URL
self.__repo_path_url = self.__repo_path.startswith("http://") or self.__repo_path.startswith("https://")

Expand Down
6 changes: 3 additions & 3 deletions tests/test_getbible.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_valid_multiple_reference_aov(self):
self.assertEqual(actual_result, expected_result, "Failed to find 'Ge1:1;Jn1:1;1Jn1:1' scripture.")

def test_valid_multiple_reference_select_aleppo(self):
actual_result = self.getbible.select('Ge1:1-3;Ps1:1;ps1:1-2;Ge1:6-7,10', 'aleppo')
actual_result = self.getbible.select('ברא 1:1-3;תה 1:1;תה1:1-2;בְּרֵאשִׁית 1:6-7,10', 'aleppo')
expected_result = {
'aleppo_19_1': {'abbreviation': 'aleppo',
'book_name': 'תְּהִלִּים',
Expand All @@ -79,7 +79,7 @@ def test_valid_multiple_reference_select_aleppo(self):
'language': 'Hebrew',
'name': 'תְּהִלִּים 1',
'translation': 'Aleppo Codex',
'ref': ['Ps1:1', 'ps1:1-2'],
'ref': ['תה 1:1', 'תה1:1-2'],
'verses': [{'chapter': 1,
'name': 'תְּהִלִּים 1:1',
'text': '\xa0\xa0אשרי האיש— \xa0\xa0 אשר לא הלך '
Expand All @@ -101,7 +101,7 @@ def test_valid_multiple_reference_select_aleppo(self):
'language': 'Hebrew',
'name': 'בְּרֵאשִׁית 1',
'translation': 'Aleppo Codex',
'ref': ['Ge1:1-3', 'Ge1:6-7,10'],
'ref': ['ברא 1:1-3', 'בְּרֵאשִׁית 1:6-7,10'],
'verses': [{'chapter': 1,
'name': 'בְּרֵאשִׁית 1:1',
'text': 'בראשית ברא אלהים את השמים ואת הארץ ',
Expand Down

0 comments on commit bc5d171

Please sign in to comment.