Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix get validation pattern, and update Hebrew test method. #7

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading