Skip to content
Merged
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
14 changes: 11 additions & 3 deletions tests/test_snowball.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@ def test_openalex_id_backward(tmpdir):
email=EMAIL,
)
df = pd.read_csv(out_fp)
assert len(df) == 40
# Actual value at time of writing test is 40 (2024-08-26).
# In theory the number of results should be stable for backward snowballing,
# but OpenAlex sometimes makes changes, so we allow for a margin.
# The margins of this assert and the next assert should not overlap,
# otherwise we don't test if 'use_all' works.
assert 38 <= len(df) <= 42

all_out_fp = Path(tmpdir, "backward_all.csv")
snowball(
Expand All @@ -134,7 +139,8 @@ def test_openalex_id_backward(tmpdir):
email=EMAIL,
)
df_all = pd.read_csv(all_out_fp)
assert len(df_all) == 45
# Actual value at time of writing test is 46 (2024-08-26).
assert 43 <= len(df_all) <= 49


def test_snowballing_from_doi(tmpdir):
Expand All @@ -148,4 +154,6 @@ def test_snowballing_from_doi(tmpdir):
email=EMAIL,
)
df = pd.read_csv(out_fp)
assert len(df) == 45
# Actual value at time of writing test is 46 (2024-08-26).
# See comments in 'test_openalex_id_backward'.
assert 43 <= len(df) <= 49
Loading