Sort the by-hand list by the Watchlist's careers_opened_at and print the watch rating

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Sonnet 5.5 committed 2026-09-29 19:25:46 +02:00
1 parent 1a2689e08d
commit 161e89c955
3 files changed
+28 -20

No files matched your search

+14 -10
View File
@@ -373,14 +373,14 @@ def test_remove_company_refuses_a_board_shown_and_open_roles(
sources.remove_company(store, "open")
def test_by_hand_lists_the_unboarded_never_checked_first(
def test_by_hand_lists_the_unboarded_never_opened_first(
store: Store, boards: Boards) -> None:
sources.add_by_hand(store, "Zeta")
sources.add_by_hand(store, "Beta")
sources.add_by_hand(store, "Old")
sources.add_by_hand(store, "Recent")
store.update_company("old", checked_at="2026-08-01T00:00:00+00:00")
store.update_company("recent", checked_at="2026-09-20T00:00:00+00:00")
store.update_company("old", careers_opened_at="2026-08-01T00:00:00+00:00")
store.update_company("recent", careers_opened_at="2026-09-20T00:00:00+00:00")
sources.set_board(store, "read", "greenhouse:acme", name="Read") # a board: not listed
store.add_company("Pleo", key="pleo", ats="teamtailor") # unread, no reason: listed
store.add_company("Quiet", key="quiet") # from a search only
@@ -486,8 +486,8 @@ def test_cli_edit_checked_and_remove_a_company_by_hand(
assert "no company 'nobody'" in capsys.readouterr().err
assert _cli(tmp_path, "checked", "acme") == 0
stamp = json.loads(capsys.readouterr().out)["checked_at"]
assert stamp and store.company("acme").checked_at == stamp # type: ignore[union-attr]
stamp = json.loads(capsys.readouterr().out)["careers_opened_at"]
assert stamp and store.company("acme").careers_opened_at == stamp # type: ignore[union-attr]
assert _cli(tmp_path, "checked", "nobody") == 1
capsys.readouterr()
@@ -499,20 +499,24 @@ def test_cli_edit_checked_and_remove_a_company_by_hand(
assert _cli(tmp_path, "remove", "acme") == 1
def test_cli_by_hand_prints_never_checked_first_then_the_oldest_check(
def test_cli_by_hand_prints_never_opened_first_then_the_oldest_and_the_watch_rating(
store: Store, boards: Boards, tmp_path: Path,
capsys: pytest.CaptureFixture[str]) -> None:
store.add_company("Recent", careers_url="https://recent.example/jobs",
hand_reason="gone", checked_at="2026-09-20T08:00:00+00:00")
store.add_company("Old", hand_reason="robots", checked_at="2026-08-01T08:00:00+00:00")
hand_reason="gone")
store.add_company("Old", hand_reason="robots")
store.add_company("Never", careers_url="https://never.example/jobs", hand_reason="added")
store.update_company("recent", careers_opened_at="2026-09-20T08:00:00+00:00", watch=0)
store.update_company("old", careers_opened_at="2026-08-01T08:00:00+00:00", watch=1)
sources.set_board(store, "read", "greenhouse:acme", name="Read")
assert _cli(tmp_path, "by-hand") == 0
lines = capsys.readouterr().out.splitlines()
assert [ln.split()[0] for ln in lines[:-1]] == ["Never", "Old", "Recent"]
assert lines[0].split() == ["Never", "added", "never", "https://never.example/jobs"]
assert lines[1].split() == ["Old", "robots", "2026-08-01"]
assert lines[0].split() == ["Never", "added", "-", "never", "https://never.example/jobs"]
assert lines[1].split() == ["Old", "robots", "yes", "2026-08-01"]
assert lines[2].split() == ["Recent", "gone", "no", "2026-09-20",
"https://recent.example/jobs"]
assert lines[-1] == "3 by hand"