diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-09 09:31:33 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-09 09:31:33 +0200 |
| commit | 994572af87ec9256a5e8dc39a1486cffa2a7e6c7 (patch) | |
| tree | 70acfefd3b6af50f41ce1d528c229f941ff78eba /tests/__init__.py | |
| parent | 4a0dadb46994da5ea73ccf93a0a4c445955f310e (diff) | |
| download | abusectl-994572af87ec9256a5e8dc39a1486cffa2a7e6c7.tar.gz abusectl-994572af87ec9256a5e8dc39a1486cffa2a7e6c7.zip | |
test: make two rdap tests able to fail, and cover the hostile bootstrap
test_the_walk_is_capped could not fail. Its host had nine labels, so the
bare-TLD guard alone bounded the walk to eight attempts and the cap was
never reached, and the assertion read rdap._MAX_LABEL_WALK at assert
time, so the expected value moved with any mutation. Raising the cap to a
billion left the suite green. It now uses a twelve-label host and a
hard-coded expected count of five, and raising the cap fails it with
11 != 5.
test_a_newline_in_an_address_is_rejected asserted a guarantee that a
different function happened to provide. email.utils.parseaddr rejects the
CRLF fixture by itself, returning an empty address, so deleting both
control-character checks from _valid_address left the suite green while
the real defence was gone. parseaddr passes \x0b and \x0c straight
through, and those reach a mail header raw, so a case for each is added
alongside the CRLF one, which is still worth asserting.
The new HostileBootstrap cases cover the bootstrap defects fixed in the
previous commit: a planted integer CIDR, a malformed services value in
seven shapes, a plaintext base URL, and the two paths where a bad entry
must not hide a good one.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wrfqr2xqQfhtXCscU7zrdz
Diffstat (limited to 'tests/__init__.py')
0 files changed, 0 insertions, 0 deletions
