Prerequisites
Install uv.Test suites
| Suite | Location | What it tests |
|---|---|---|
| Unit tests | python_modules/proxy-hopper/tests/ | Core package — config, pool, handlers, auth, identity, CLI |
| Integration tests | python_modules/proxy-hopper-testserver/tests/ | End-to-end — TargetManager + MockProxy + UpstreamServer |
| Redis tests | python_modules/proxy-hopper-redis/tests/ | Redis backend — requires a running Redis instance |
Running tests
Running Redis locally
Test options
Integration test utilities
Theproxy-hopper-testserver package provides test doubles for integration tests:
UpstreamServer— a controllable aiohttp HTTP server. Set it to respond with 200, 429, 503, hang, or close connections on demand.MockProxy— a TCP server that simulates an external proxy IP. Can forward, refuse, hang, or return error responses.MockProxyPool— manages a set ofMockProxyinstances as a named IP pool.
CI
Tests run on every push via GitHub Actions. The workflow:- Runs the core unit tests
- Runs the integration tests (fakeredis)
- Runs the Redis backend tests against a real Redis service container
- Builds the Docker image and validates it starts correctly