Skip to content

Commit

Permalink
Rename private method
Browse files Browse the repository at this point in the history
  • Loading branch information
wvanhed committed Dec 10, 2023
1 parent 2e5e60a commit c5fbcdc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/mijnbib/mijnbibliotheek.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def get_loans(self, account_id: str) -> list[Loan]:
url = self.BASE_URL + f"/mijn-bibliotheek/lidmaatschappen/{account_id}/uitleningen"
html_string = self._open_account_loans_page(url)
try:
loans = self._parse_account_loan_page(html_string, self.BASE_URL)
loans = self._parse_account_loans_page(html_string, self.BASE_URL)
except Exception as e:
raise IncompatibleSourceError(f"Problem scraping loans ({str(e)})", "") from e
return loans
Expand Down Expand Up @@ -448,7 +448,7 @@ def _parse_item_count_from_li(acc_div, class_: str) -> int | None:
return item_count

@classmethod
def _parse_account_loan_page(cls, html: str, base_url: str) -> list[Loan]:
def _parse_account_loans_page(cls, html: str, base_url: str) -> list[Loan]:
"""Return loans
>>> html_string='''
Expand Down Expand Up @@ -498,7 +498,7 @@ def _parse_account_loan_page(cls, html: str, base_url: str) -> list[Loan]:
... </div>
... </div>
... '''
>>> MijnBibliotheek._parse_account_loan_page(html_string,"https://city.bibliotheek.be") # doctest: +NORMALIZE_WHITESPACE
>>> MijnBibliotheek._parse_account_loans_page(html_string,"https://city.bibliotheek.be") # doctest: +NORMALIZE_WHITESPACE
[Loan(title='Erebus', loan_from=datetime.date(2023, 11, 25), loan_till=datetime.date(2023, 12, 23),
author='Palin, Michael', type='Boek', extendable=True,
extend_url='https://city.bibliotheek.be/mijn-bibliotheek/lidmaatschappen/374052/uitleningen/verlengen?loan-ids=6207416',
Expand Down
4 changes: 2 additions & 2 deletions tests/test_mijnbibliotheek.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def test_parse_item_count_from_li():
assert MijnBibliotheek._parse_item_count_from_li("", "") is None


def test_parse_account_loan_page():
def test_parse_account_loans_page():
# Happy flow test --> see doctest
assert MijnBibliotheek._parse_account_loan_page("", "") == []
assert MijnBibliotheek._parse_account_loans_page("", "") == []


def test_parse_account_reservations_page():
Expand Down

0 comments on commit c5fbcdc

Please sign in to comment.