Files
jobboard/tests/test_ats_ashby.py
T
WolfandClaude Fable 5.1 2349fc424b Require READS, search params and a dated robots record; record robots.txt per requested path
Every reader declares, so undeclared(), the scope() fallback, robots_page and
ROBOTS_ANY_CASE go. A search provider needs PARAMS and clean_params, a row may
carry company, places gains none. Each robots record names the paths the
reader requests, from robots.txt read again on 2026-09-30. Platsbanken states
remote, HR Manager states no place.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-30 15:51:13 +02:00

45 lines
1.8 KiB
Python

"""The Ashby host module's places, work arrangement and employment, against a
small saved board. No network. The pay and the shape of a plain row are in
`test_ats.py`."""
from __future__ import annotations
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
from plugins.readers import Ask, ashby # noqa: E402
BOARD = (ROOT / "tests" / "fixtures" / "ats" / "ashby-places.json").read_bytes()
def test_the_primary_and_every_secondary_location_are_places() -> None:
first, second = ashby.parse(BOARD, "acme")
assert first["places"] == [{"text": "San Francisco", "remote": False},
{"text": "London, UK", "remote": None},
{"text": "Remote - US", "remote": True}]
assert first["location"] == "San Francisco; London, UK; Remote - US"
assert second["places"] == [{"text": "Dublin", "remote": True}]
def test_remote_is_the_workplace_type_as_the_host_writes_it() -> None:
first, second = ashby.parse(BOARD, "acme")
assert first["remote"] == "Hybrid" and second["remote"] == "Remote"
def test_the_employment_type_is_the_hosts_word() -> None:
first, second = ashby.parse(BOARD, "acme")
assert (first["employment"], second["employment"]) == ("FullTime", "Contract")
def test_it_declares_a_whole_listing_of_trusted_dates_and_its_robots_record() -> None:
reads = ashby.READS
assert (reads.listing, reads.text, reads.places, reads.empty) == (
"whole", "listing", "many", "suspect")
assert reads.fields.posted == "trusted" and reads.fields.pay == "figures"
assert reads.robots.startswith("read: ") and "(checked 2026-09-30)" in reads.robots
assert ashby.feed_url("acme", Ask()).endswith("/job-board/acme?includeCompensation=true")