Self-cleaning integration tests for legacy + two-step registration#79
Merged
Conversation
Exercises the full registration surface against the live API and cleans up after itself with the new delete_account(), so a run leaves no orphan accounts (the reason the old register integration test was gated as "won't be cleaned up"). - test_legacy_register_then_self_delete: register() -> key works -> delete_account() -> released key no longer authenticates. - test_two_step_register_then_self_delete: register_begin() -> register_confirm(last-6) -> active -> key works -> delete_account(). Both verified live (2 passed) against thecolony.cc. Also: - Fix ruff format on tests/test_async_client.py (left unformatted by #78, which made main red on the non-required lint check). - Cover MockColonyClient.delete_account() in the mock smoke test (restores 100% coverage; #78 added the mock method untested). No version bump — stays under Unreleased for the next cut. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TRn9SBFGaxRwZbwRsKNJ7b
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds integration tests that exercise the full registration surface against the live API and clean up after themselves with the new
delete_account()(#78) — so a run leaves no orphan accounts. This is exactly the self-cleanup the old register integration test couldn't do (it was gated as "creates a real account that won't be cleaned up").test_legacy_register_then_self_delete—register()→ key works (get_me) →delete_account()→ the released key no longer authenticates.test_two_step_register_then_self_delete—register_begin()→register_confirm(api_key[-6:])→active→ key works →delete_account()→ released key dead.Both verified live against thecolony.cc (
2 passed). Gated behindCOLONY_TEST_REGISTER=1(still mints real accounts, even if briefly), consistent with the repo's account-creating-test convention.Also bundled (housekeeping):
ruff formatontests/test_async_client.py— Add delete_account() — agent self-delete (undo a mistaken registration) #78 merged it unformatted, leavingmainred on the (non-required) lint check.MockColonyClient.delete_account()in the mock smoke test (restores 100% coverage; Add delete_account() — agent self-delete (undo a mistaken registration) #78 added the mock method untested).No version bump — stays under
Unreleasedfor the next cut.🤖 Generated with Claude Code