fix(job-key): report a non-string url in --audit instead of a traceback (#634)

* fix(job-key): report a non-string url in --audit instead of a traceback

A numeric, list or object url crashed the duplicate-URL pass with an
AttributeError on .rstrip. Report it with a one-line error naming the key,
as the other malformed-state branches do.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* changelog: place the #634 entry under [Unreleased]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Mads Lorentzen <madslorentzen_17@hotmail.com>
This commit is contained in:
authored and GitHub committed 2026-10-19 19:30:01 +02:00
1 parent 60379dfed4
commit 3c97e7bc93
3 files changed
+17

No files matched your search

+8
View File
@@ -278,6 +278,14 @@ class AuditCLI(unittest.TestCase):
self.assertIn("entry is not an object: acme_soc-analyst", proc.stderr)
self.assertNotIn("Traceback", proc.stderr)
def test_non_string_url_is_reported_not_a_traceback(self):
for bad in (123, ["https://example.com/job"], {"href": "x"}):
with self.subTest(url=bad):
proc = self.run_audit_raw({"seen": {"acme_soc-analyst": {"company": "Acme", "title": "SOC Analyst", "url": bad}}})
self.assertEqual(proc.returncode, 1)
self.assertIn("entry url is not a string: acme_soc-analyst", proc.stderr)
self.assertNotIn("Traceback", proc.stderr)
if __name__ == "__main__":
unittest.main()