Test domain interception matching (exact, wildcard, and non-matching cases).
(proxy_server)
| 15 | |
| 16 | |
| 17 | def test_should_intercept(proxy_server): |
| 18 | """Test domain interception matching (exact, wildcard, and non-matching cases).""" |
| 19 | # Exact match |
| 20 | assert proxy_server.should_intercept("api.test.com") is True |
| 21 | |
| 22 | # Wildcard match |
| 23 | assert proxy_server.should_intercept("sub.example.com") is True |
| 24 | assert proxy_server.should_intercept("deep.sub.example.com") is True |
| 25 | |
| 26 | # No match |
| 27 | assert proxy_server.should_intercept("other.com") is False |
| 28 | assert proxy_server.should_intercept("example.org") is False |
| 29 | |
| 30 | # Edge case: wildcard logic check |
| 31 | # "*.example.com" -> suffix ".example.com" |
| 32 | # "example.com" does not end with ".example.com" |
| 33 | assert proxy_server.should_intercept("example.com") is False |
| 34 | |
| 35 | |
| 36 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected