diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-10 16:41:57 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-10 16:41:57 +0200 |
| commit | 4e3d9f9620c9f8c15effea95756257fd06834768 (patch) | |
| tree | 3e8aa0a0f6a9c8f8f1d0c15e408f178617881249 /tests/test_report.py | |
| parent | 0d4ee047677b8b7b441b2d3d98401521396a321d (diff) | |
| download | abusectl-4e3d9f9620c9f8c15effea95756257fd06834768.tar.gz abusectl-4e3d9f9620c9f8c15effea95756257fd06834768.zip | |
feat: add the destination table, transcribed from vendor docs
Names what each report destination accepts (misp: any type, abusedb:
ipv4/ipv6, urlhaus: url), read from each vendor's own API documentation
on 2026-09-10. Nothing consumes it yet.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0176FYdVfpzUq8S9jecqQqL6
Diffstat (limited to 'tests/test_report.py')
| -rw-r--r-- | tests/test_report.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_report.py b/tests/test_report.py index c8c39f8..6d1f845 100644 --- a/tests/test_report.py +++ b/tests/test_report.py @@ -2029,3 +2029,23 @@ class PersonalisedSubject(unittest.TestCase): # the fix is a redaction rule with its own tests, not a passthrough # quietly turned into a filter. self.assertIn("alicejones", self._headers()["Subject"]) + + +class DestinationTable(unittest.TestCase): + def test_every_destination_names_the_types_it_accepts(self): + self.assertEqual(report.DESTINATIONS["abusedb"]["accepts"], + ("ipv4", "ipv6")) + self.assertEqual(report.DESTINATIONS["urlhaus"]["accepts"], ("url",)) + self.assertEqual(report.DESTINATIONS["misp"]["accepts"], report.ALL_TYPES) + + def test_misp_is_its_own_kind_and_the_vendors_are_api(self): + self.assertEqual(report.DESTINATIONS["misp"]["kind"], "misp") + self.assertEqual(report.DESTINATIONS["abusedb"]["kind"], "api") + self.assertEqual(report.DESTINATIONS["urlhaus"]["kind"], "api") + + def test_all_types_covers_what_parse_emits(self): + # The five type strings parse.py writes. A sixth arriving without a + # decision about which destinations accept it would silently reach + # MISP only, so this test names them rather than deriving them. + self.assertEqual(report.ALL_TYPES, + ("ipv4", "ipv6", "domain", "url", "sha256")) |
