Cover egress_addon adapter and remove coverage omit #290
Reference in New Issue
Block a user
Delete Branch "cover-egress-addon-adapter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #286.
Summary
bot_bottle/egress_addon.py— the mitmproxy adapter that wires the host-importable decision logic (egress_addon_core) into mitmproxy's request/response hooks — was excluded from coverage in.coveragerc. The core logic and the log-redaction helpers were tested, but the adapter glue itself was unexercised.This adds
tests/unit/test_egress_addon_request_flow.py, which stubs the sidecar-onlymitmproxyimport and drivesEgressAddonend to end:/allowlist, 404)block,redact, andsupervise(operator approval, rejection, and timeout round-trips)The
bot_bottle/egress_addon.pyomit is removed from.coveragerc; the adapter now reports ~76% line coverage. Full unit suite (1317 tests) passes; pyright clean; pylint 9.64 on the new file.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.