mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-13 07:10:58 +01:00
First module of the tool/ coverage task. It is the one the task was raised for: _start_callback_server's runtime path had never been exercised, and it is the only tool/ module with no network dependency, so it needs no mocking. Driven over real HTTP against 127.0.0.1 on a port the module picks, rather than with a faked request object. The branches worth protecting only exist once a socket is involved -- particularly the /favicon.ico fetch that must be answered without being recorded, since treating it as the callback retires the server before Google ever redirects and surfaces to the user as a consent timeout. Both serve-loop exits are covered: a result arriving, and the deadline passing (monkeypatched negative rather than waiting out 300s). Writing them surfaced a teardown race, not a bug in the module: calling server_close() while the worker is still inside handle_request() pulls the socket out from under it and raises on the thread. Invisible normally and deterministic under --cov, whose tracer widens the window -- so the tests retire the thread through the loop's own exit condition before closing, via one _retire helper. Verified over 6 consecutive --cov runs. crdt_sync 259 -> 268 passed, still 100%. tool/ is not yet in the coverage source, so the config flip stays last, per the prompt. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CFSGeWxHPY5rHUGrPqhcmG |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| conftest.py | ||
| test_config_client.py | ||
| test_config_credentials.py | ||
| test_config.py | ||
| test_device.py | ||
| test_firebase_auth_google.py | ||
| test_firebase_auth_session.py | ||
| test_firebase_auth_tokens.py | ||
| test_firebase_auth.py | ||
| test_firebase_writes.py | ||
| test_firebase.py | ||
| test_github_writes.py | ||
| test_github.py | ||
| test_hlc.py | ||
| test_log.py | ||
| test_mirror_fallback.py | ||
| test_mirror.py | ||
| test_record.py | ||
| test_store.py | ||
| test_sync_revisions_backends.py | ||
| test_sync_revisions_peers.py | ||
| test_sync_revisions.py | ||
| test_sync_skips.py | ||
| test_sync.py | ||
| test_tool_oauth_callback.py | ||