Create ProxyServer with mocked dependencies.
(mock_deps)
| 46 | |
| 47 | @pytest.fixture |
| 48 | def proxy_server(mock_deps): |
| 49 | """Create ProxyServer with mocked dependencies.""" |
| 50 | queue = multiprocessing.Queue() |
| 51 | # Immediately call cancel_join_thread to prevent feeder thread from hanging the process |
| 52 | queue.cancel_join_thread() |
| 53 | server = ProxyServer( |
| 54 | host="127.0.0.1", port=3120, intercept_domains=["*.google.com"], queue=queue |
| 55 | ) |
| 56 | yield server |
| 57 | # Explicitly close the queue to release resources |
| 58 | queue.close() |
| 59 | |
| 60 | |
| 61 | # ==================== TESTS: handle_client ==================== |
nothing calls this directly
no test coverage detected