Delete the _UNREADABLE entries of hosts that have a module
Ten entries were shadowed by their modules. A test now holds that no entry names a reader, which replaces the per-host checks. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
5f1b9e93e1
commit
531c8bc337
7 files changed
+11
-18
No files matched your search
@@ -187,4 +187,3 @@ def test_discovery_finds_the_subdomain_and_not_bamboohrs_own_hosts() -> None:
|
||||
'<a href="https://www.bamboohr.com/">x</a><a href="https://app.bamboohr.com/x">y</a>'
|
||||
'<a href="https://resources.bamboohr.com/y">z</a>')
|
||||
assert [(h, s) for h, s, _ in discover.boards_in(page)] == [("bamboohr", "configit")]
|
||||
assert "bamboohr" not in {h for h, _ in discover._UNREADABLE if h not in readers.HOSTS}
|
||||
@@ -201,7 +201,6 @@ def test_discovery_reads_the_host_and_domain_from_a_link_that_has_both() -> None
|
||||
found = [(h, s) for h, s, _ in discover.boards_in(page)]
|
||||
assert ("eightfold", "infineon.eightfold.ai/infineon.com") in found
|
||||
assert ("eightfold", "") in found
|
||||
assert "eightfold" not in {h for h, _ in discover._UNREADABLE if h not in readers.HOSTS}
|
||||
|
||||
|
||||
def test_it_declares_a_paged_read_of_ten_with_a_total_and_one_country_a_request() -> None:
|
||||
|
||||
@@ -178,4 +178,3 @@ def test_discovery_finds_the_board_keeping_its_case() -> None:
|
||||
'<a href="https://jobs.gem.com/sennder-gmbh/8080046002">y</a>')
|
||||
assert [(h, s) for h, s, _ in discover.boards_in(page)] == [
|
||||
("gem", "Productboard"), ("gem", "sennder-gmbh")]
|
||||
assert "gem" not in {h for h, _ in discover._UNREADABLE if h not in readers.HOSTS}
|
||||
@@ -176,7 +176,6 @@ def test_discovery_names_jibe_from_its_assets_but_gives_no_host() -> None:
|
||||
page = ('<img src="https://cms.jibecdn.com/prod/workingatbooking/assets/logo.png">'
|
||||
'<a href="https://workingatbooking.jibeapply.com/jobs">apply</a>')
|
||||
assert [(h, s) for h, s, _ in discover.boards_in(page)] == [("jibe", "")]
|
||||
assert "jibe" not in {h for h, _ in discover._UNREADABLE}
|
||||
|
||||
|
||||
def test_it_declares_a_paged_read_with_a_total_and_many_places() -> None:
|
||||
|
||||
@@ -145,7 +145,6 @@ def test_discovery_finds_the_subdomain() -> None:
|
||||
'<script src="https://www.pinpointhq.com/embed.js"></script>')
|
||||
assert [(h, s) for h, s, _ in discover.boards_in(page)] == [("pinpoint", "xeneta")]
|
||||
assert discover.boards_in("https://pinpointhq.com/") == []
|
||||
assert "pinpoint" not in {h for h, _ in discover._UNREADABLE if h not in readers.HOSTS}
|
||||
|
||||
|
||||
def test_a_pinpoint_board_is_not_probed() -> None:
|
||||
|
||||
@@ -17,6 +17,7 @@ from app.jobs import discover as mod
|
||||
from app.jobs.discover import Discovery, boards_in, careers_links, discover, slug_guesses
|
||||
from app.jobs.sources import seed_companies
|
||||
from app.storage import Store
|
||||
from plugins import readers
|
||||
|
||||
|
||||
# ------------------------------------------------------------------ parsing
|
||||
@@ -95,6 +96,12 @@ def test_a_host_that_gains_a_module_replaces_its_unreadable_pattern() -> None:
|
||||
assert "taleo" not in mod.READABLE and ("taleo", r"\.taleo\.net") in mod._UNREADABLE
|
||||
|
||||
|
||||
def test_no_unreadable_entry_names_a_host_with_a_module() -> None:
|
||||
"""A new module deletes its host's `_UNREADABLE` entry: its own patterns
|
||||
replace it."""
|
||||
assert not {host for host, _ in mod._UNREADABLE} & set(readers.HOSTS)
|
||||
|
||||
|
||||
def test_boards_in_dedupes_and_skips_the_api_paths_own_words() -> None:
|
||||
page = ('<a href="https://boards.greenhouse.io/embed/job_board?for=acme">a</a>'
|
||||
'<a href="https://boards-api.greenhouse.io/v1/boards/acme/jobs">b</a>')
|
||||
|
||||
Reference in new issue
Block a user