Discover Teamtailor boards as readable, own-domain sites by their host

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Sonnet 5.5 committed 2026-09-29 16:14:41 +02:00
1 parent 50edf0eeeb
commit b2ab2a270d
2 files changed
+74 -8

No files matched your search

+43 -3
View File
@@ -160,7 +160,7 @@ def test_a_readable_board_on_a_later_page_still_beats_an_unreadable_host() -> No
assert site.probed == []
def test_an_unreadable_hosts_slug_is_kept_when_a_later_link_names_it() -> None:
def test_a_teamtailor_link_is_a_board_even_after_the_cdn_named_it_first() -> None:
"""The CDN names teamtailor before any link does; the slug comes from the
first link that carries one, the acme of acme.teamtailor.com."""
site = Site({
@@ -168,9 +168,49 @@ def test_an_unreadable_hosts_slug_is_kept_when_a_later_link_names_it() -> None:
"https://acme.com/careers": '<a href="https://acme-jobs.teamtailor.com/jobs">Jobs</a>',
})
found = run(site)
assert (found.ats, found.ats_slug, found.board) == ("teamtailor", "acme-jobs", "")
assert (found.ats, found.ats_slug, found.board) == ("teamtailor", "acme-jobs",
"teamtailor:acme-jobs")
assert found.readable
assert found.evidence == "https://acme-jobs.teamtailor.com"
assert found.careers_url == "https://acme.com/"
assert found.careers_url == "https://acme.com/careers"
def test_a_teamtailor_site_on_its_own_domain_is_read_off_its_host() -> None:
"""Only the CDN is named, so the site's host is the slug, once that host
serves the feed."""
site = Site({
"https://acme.com/": '<a href="https://careers.acme.com/">Careers</a>',
"https://careers.acme.com/": '<script src="https://cdn.teamtailor.com/x.js"></script>',
"https://careers.acme.com/jobs.rss":
'<rss xmlns:tt="https://teamtailor.com/locations"><channel/></rss>',
})
found = run(site)
assert found == Discovery(board="teamtailor:careers.acme.com", ats="teamtailor",
ats_slug="careers.acme.com",
careers_url="https://careers.acme.com/",
evidence="https://careers.acme.com/jobs.rss")
assert site.probed == []
def test_a_page_that_only_loads_the_cdn_is_not_a_board_without_the_feed() -> None:
site = Site({"https://acme.com/": '<script src="https://cdn.teamtailor.com/x.js"></script>'})
found = run(site)
assert (found.ats, found.ats_slug, found.board) == ("teamtailor", "", "")
assert not found.readable
assert "https://acme.com/jobs.rss" in site.fetched
def test_the_admin_app_and_cdn_hosts_are_no_teamtailor_slug() -> None:
page = '<a href="https://app.teamtailor.com/x">a</a><img src="https://cdn.teamtailor.com/y">'
assert [(h, s) for h, s, _ in boards_in(page)] == [("teamtailor", "")]
def test_a_teamtailor_board_is_found_by_its_slug_probe() -> None:
site = Site({"https://acme.com/": "<p>a script draws the jobs</p>"},
boards={("teamtailor", "acme")})
found = run(site)
assert found.board == "teamtailor:acme"
assert found.evidence == "https://acme.teamtailor.com/jobs.rss"
def test_slug_probes_find_a_board_the_pages_never_link() -> None: