Create ProxyServer instance with mocked dependencies.
(mock_cert_manager, mock_proxy_connector, mock_interceptor)
| 125 | |
| 126 | @pytest.fixture |
| 127 | def proxy_server(mock_cert_manager, mock_proxy_connector, mock_interceptor): |
| 128 | """Create ProxyServer instance with mocked dependencies.""" |
| 129 | with patch("logging.getLogger"): |
| 130 | queue = multiprocessing.Queue() |
| 131 | # Immediately call cancel_join_thread to prevent feeder thread from hanging the process |
| 132 | queue.cancel_join_thread() |
| 133 | server = ProxyServer( |
| 134 | host="127.0.0.1", port=3120, intercept_domains=["*.google.com"], queue=queue |
| 135 | ) |
| 136 | yield server |
| 137 | # Explicitly close the queue to release resources |
| 138 | queue.close() |
| 139 | |
| 140 | |
| 141 | # ==================== TESTS: _forward_data (No Interception) ==================== |
nothing calls this directly
no test coverage detected