Search providers as reader modules: jobindex, adzuna, platsbanken
Each declares READS with scope=search, keeps every place and hands the excerpt over as teaser. search_params and PROVIDERS follow the declarations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4c0da58da7
commit
b78c9dfc67
14 files changed
+1202
-17
No files matched your search
@@ -573,6 +573,17 @@ def test_search_params_keeps_only_what_the_provider_reads() -> None:
|
||||
"q": "data", "region": "CaRE_1nn_cSU", "pages": 3}
|
||||
|
||||
|
||||
def test_the_providers_and_their_params_follow_the_reader_declarations() -> None:
|
||||
from plugins import readers
|
||||
|
||||
assert sources.PROVIDERS == tuple(readers.PROVIDERS) == ("jobindex", "adzuna", "platsbanken")
|
||||
assert sources.search_params("adzuna", " backend ", country=" DE ", where=" Berlin ",
|
||||
area=1, region="x", pages=2) == {
|
||||
"q": "backend", "country": "de", "where": "Berlin", "pages": 2}
|
||||
with pytest.raises(ValueError, match="country"):
|
||||
sources.search_params("adzuna", "backend", country="dk")
|
||||
|
||||
|
||||
def test_search_params_refuses_a_region_that_is_no_swedish_lan() -> None:
|
||||
with pytest.raises(ValueError, match="region"):
|
||||
sources.search_params("platsbanken", "data", region="zYpL_aGk_QY8") # Midland
|
||||
|
||||
Reference in new issue
Block a user