Skip to content

Commit

Permalink
speed up tests by saving 1 request
Browse files Browse the repository at this point in the history
  • Loading branch information
JKatzwinkel committed Jul 18, 2023
1 parent ab37221 commit f7ed8c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions oai_status/list_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def yield_records(doc: Document) -> Iterable[TagNode]:
yield from yield_records(doc)
if not counter.left:
return

while resumption_token := get_resumption_token(doc):
doc = request_list_records(setSpec, metadata_prefix, resumption_token)
yield from yield_records(doc)
Expand Down
5 changes: 3 additions & 2 deletions tests/test_list_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ def test_list_records_limited():


def test_list_records_limited_paging():
records = list(list_records('illustrierte.liedflugschriften', limit=125))
assert len(records) == 125
assert len(
list(list_records('illustrierte.liedflugschriften', limit=75))
) == 75


def test_entrypoint():
Expand Down

0 comments on commit f7ed8c9

Please sign in to comment.