aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_case.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-08 15:02:31 +0200
committerDanilo M. <danix@danix.xyz>2026-09-08 15:02:31 +0200
commit73a407f96076a971078b47be8586d114f437172b (patch)
tree1d6ec8ec09b5dd976db955689d8e1cda932221ee /tests/test_case.py
parentacbd2b882a8a10e616d161b69dccc3e73d01c873 (diff)
downloadabusectl-73a407f96076a971078b47be8586d114f437172b.tar.gz
abusectl-73a407f96076a971078b47be8586d114f437172b.zip
fix: validate each setup answer at the prompt that asked for it
Five defects from the user's hand test of the interactive setup, four of them the same mistake: an answer was validated somewhere other than where it was given, so a typo cost the whole run. A bad CIDR was only rejected after the NEXT question had been asked and answered, and both answers were then discarded. It is validated at its own prompt now and re-asks, so a mistake costs one retry. A provider name typed at the first prompt was treated as a CIDR, so "Gmail" produced "does not appear to be an IPv4 or IPv6 network", which names nothing the user can act on. The prompt takes either answer now and tries the provider table first, because the user does not know, and should not have to know, which of the two questions they are answering. Picking a hop number out of range raised a bare IndexError, and a non-numeric pick leaked int()'s own message about base 10. Both re-ask naming the valid range. The first question said what to type without saying what it was for. It now states that the boundary decides which address gets reported, which is the fact that makes a wrong answer matter. Ctrl+C and EOF are caught in main() and report that nothing was written. Setup writes nothing until every answer is in hand, so abandoning it midway leaves no half-written config, and that was already true; it just said so with a traceback. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KphFXTc2QajxXsHWyvGJ4R
Diffstat (limited to 'tests/test_case.py')
0 files changed, 0 insertions, 0 deletions