mirror of
https://github.com/calibrain/shelfmark.git
synced 2026-10-05 22:05:50 +01:00
- Added heuristic-based author and title query creation, stripping out unnecessary elements that could limit searches - Improved language support when using Hardcover. Searches will now be conducted on a per-language basis using localized book titles. - Added manual search override option in the release modal.
16 lines
620 B
Python
16 lines
620 B
Python
from shelfmark.metadata_providers.hardcover import _simplify_author_for_search
|
|
|
|
|
|
class TestHardcoverSimplifyAuthorForSearch:
|
|
def test_removes_middle_initial(self):
|
|
assert _simplify_author_for_search("Robert R. McCammon") == "Robert McCammon"
|
|
|
|
def test_keeps_suffix(self):
|
|
assert _simplify_author_for_search("Martin L. King Jr.") == "Martin King Jr."
|
|
|
|
def test_handles_comma_format(self):
|
|
assert _simplify_author_for_search("McCammon, Robert R.") == "Robert McCammon"
|
|
|
|
def test_returns_none_when_no_change(self):
|
|
assert _simplify_author_for_search("Frank Herbert") is None
|