Let the runner drop and count a row without an id, a title or a link, as ADR Plugins 3.8 has it, in one place for whole, paged and search reads: the count is stamped per target, logged, named on the board's row, and over 10% of the rows fails the read; the 28 readers hand every listing over instead of skipping it
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
38c31c830b
commit
911dfe8584
58 files changed
+479
-203
No files matched your search
@@ -18,7 +18,7 @@ if str(ROOT) not in sys.path:
|
||||
|
||||
from app.jobs.discover import boards_in # noqa: E402
|
||||
from plugins import ats, readers # noqa: E402
|
||||
from plugins.readers import rippling # noqa: E402
|
||||
from plugins.readers import _runner, rippling # noqa: E402
|
||||
|
||||
FIXTURES = ROOT / "tests" / "fixtures" / "ats"
|
||||
BOARD = (FIXTURES / "rippling.json").read_bytes()
|
||||
@@ -61,11 +61,14 @@ def test_an_empty_board_is_no_roles_and_an_error_answer_is_not_a_board() -> None
|
||||
rippling.parse(b'{"error_code":"RESOURCE_NOT_FOUND"}', "acme")
|
||||
|
||||
|
||||
def test_an_entry_without_a_title_or_a_plain_id_is_skipped() -> None:
|
||||
def test_an_entry_without_a_title_or_a_plain_id_is_dropped_by_the_runner() -> None:
|
||||
body = json.dumps([{"uuid": "abcdefgh-1", "name": " "}, {"name": "B"},
|
||||
{"uuid": "../../x", "name": "C"},
|
||||
{"uuid": "abcdefgh-2", "name": "D"}]).encode()
|
||||
assert [r["source_id"] for r in rippling.parse(body, "acme")] == ["abcdefgh-2"]
|
||||
rows = rippling.parse(body, "acme")
|
||||
assert [r["source_id"] for r in rows] == ["abcdefgh-1", "", "../../x", "abcdefgh-2"]
|
||||
assert rows[2]["url"] == "" # the id builds no link
|
||||
assert [r["source_id"] for r in rows if _runner.valid(r)] == ["abcdefgh-2"]
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- detail
|
||||
|
||||
Reference in new issue
Block a user