Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
unfortunately this test demopnstrates the correct result
of not matching the light record, so it's still unclear why a dated
record matched an undated record with an ISBN.
More investigation is required.
  • Loading branch information
hornc committed Sep 2, 2024
1 parent 6e27575 commit 5f293be
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions openlibrary/catalog/add_book/tests/test_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ def test_matching_title_author_and_publish_year_but_not_publishers(self) -> None
'publishers': ['Standard Ebooks'],
'title': 'Spoon River Anthology',
}

assert threshold_match(existing_edition, potential_match1, THRESHOLD) is False

potential_match2 = {
Expand All @@ -401,6 +400,24 @@ def test_matching_title_author_and_publish_year_but_not_publishers(self) -> None
'title': 'Spoon River Anthology',
}

# If there i s no publisher and nothing else to match, the editions should be
# If there is no publisher and nothing else to match, the editions should be
# indistinguishable, and therefore matches.
assert threshold_match(existing_edition, potential_match2, THRESHOLD) is True

def test_noisbn_record_should_not_match_title_only(self):
# An existing light title + ISBN only record
existing_edition = {
# NO author
# NO date
#'publishers': ['Creative Media Partners, LLC'],
'title': 'Just A Title',
'isbn_13': ['9780000000002'],
}
potential_match = {
'authors': [{'name': 'Bob Smith'}],
'publish_date': '1913',
'publishers': ['Early Editions'],
'title': 'Just A Title',
'source_records': ['marc:somelibrary/some_marc.mrc'],
}
assert threshold_match(existing_edition, potential_match, THRESHOLD) is False

0 comments on commit 5f293be

Please sign in to comment.