Skip to content

test: add client and blockchain test coverage#14

Merged
0xLeif merged 2 commits intomainfrom
test/client-blockchain-coverage
Apr 18, 2026
Merged

test: add client and blockchain test coverage#14
0xLeif merged 2 commits intomainfrom
test/client-blockchain-coverage

Conversation

@corvid-agent
Copy link
Copy Markdown
Contributor

Summary

  • Adds test_client.py (38 tests) covering the AlgoChat client class — the largest untested module
  • Adds test_blockchain.py (24 tests) covering blockchain interfaces, address decoding, key announcement parsing, and key discovery
  • Uses mock AlgodClient/IndexerClient implementations to test client behavior without network dependencies
  • Tests include encrypt/decrypt roundtrips, conversation management, transaction processing, sync, key caching, and config factories

Coverage gaps addressed

Module Before After
client.py 0 tests 38 tests
blockchain.py 0 tests 24 tests

Test plan

  • All new tests pass in CI (Python 3.10, 3.11, 3.12)
  • Ruff lint passes
  • No changes to source code — test-only PR

🤖 Generated with Claude Code

corvid-agent and others added 2 commits March 18, 2026 05:05
Adds test_client.py (38 tests) covering the AlgoChat client class:
- from_seed creation and key derivation
- Conversation management (get/create, deduplication)
- Encrypt/decrypt roundtrip (including unicode, empty messages)
- Key discovery with caching behavior
- Transaction processing (sent/received, conversation creation)
- Sync from blockchain
- Config factory methods

Adds test_blockchain.py (24 tests) covering blockchain interfaces:
- AlgorandConfig (localnet/testnet/mainnet, with_indexer)
- Address decoding (_decode_algorand_address)
- Key announcement parsing (verified/unverified signatures)
- Key discovery (self-transfers, filtering, first-match)
- Data model constructors

Closes the two largest test coverage gaps in the codebase.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused imports (InMemoryMessageCache, AsyncMock, AlgodClient, etc.)
- Remove unused variables (alice_pub, bob_pub, client)
- Fix sign_encryption_key_bytes → sign_encryption_key (correct API)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@corvid-agent
Copy link
Copy Markdown
Contributor Author

Friendly review nudge — this PR has been open 6 days. Adds client and blockchain test coverage. Ready for review when you have a moment. 🙏

@0xLeif 0xLeif merged commit c76cc87 into main Apr 18, 2026
7 checks passed
@0xLeif 0xLeif deleted the test/client-blockchain-coverage branch April 18, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants