diff options
Diffstat (limited to 'docs/plans')
| -rw-r--r-- | docs/plans/2026-09-09-contacts.md | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/docs/plans/2026-09-09-contacts.md b/docs/plans/2026-09-09-contacts.md index 40392d8..244fdce 100644 --- a/docs/plans/2026-09-09-contacts.md +++ b/docs/plans/2026-09-09-contacts.md @@ -1678,7 +1678,17 @@ from abusectl import contacts, parse, rdap class NothingOpensASocket(unittest.TestCase): def setUp(self): - for name in ("socket", "create_connection", "getaddrinfo"): + # socket.socket.connect, NOT socket.socket: replacing the class + # itself breaks the ssl module at import time and produces false + # failures that have nothing to do with network use. + patcher = mock.patch.object( + socket.socket, "connect", + side_effect=AssertionError("socket.socket.connect was called"), + ) + patcher.start() + self.addCleanup(patcher.stop) + + for name in ("create_connection", "getaddrinfo"): patcher = mock.patch.object( socket, name, side_effect=AssertionError(f"socket.{name} was called"), @@ -1935,15 +1945,27 @@ Update the Planned line to name only `report`, `submit` and `retry`. Add `contacts` to the usage section beside `parse`, matching the existing style, including that it needs network and that a re-run is safe. -- [ ] **Step 4: Run the suite one final time** +- [ ] **Step 4: Tidy the imports in `abusectl/rdap.py`** + +The module was built one task at a time, so `os`, `pathlib`, `time`, +`ipaddress` and `email.utils` are imported mid-file, after function +definitions, rather than grouped at the top. Move every import to the top of +the file in one block, standard library alphabetical, matching the other +modules in `abusectl/`. Change nothing else: this is a move, not a rewrite. + +Run: `python3 -m unittest discover tests` +Expected: OK, the same count as before the move. If the count changes, the +move broke something; revert and redo it. + +- [ ] **Step 5: Run the suite one final time** Run: `python3 -m unittest discover tests` Expected: OK -- [ ] **Step 5: Commit** +- [ ] **Step 6: Commit** ```bash -git add AGENTS.md README.md docs/BACKLOG.md +git add AGENTS.md README.md docs/BACKLOG.md abusectl/rdap.py git commit -S -m "docs: record the fourth property and the contacts command An RDAP query discloses what the user is looking at, and property 1 |
