forked from kenzuya/unshackle
test: delete slow, timing-based and redundant tests
This commit is contained in:
@@ -114,13 +114,6 @@ def test_remote_cdm_host_does_not_warn(caplog, monkeypatch):
|
||||
assert leaks(caplog) == []
|
||||
|
||||
|
||||
@pytest.mark.parametrize("host", ["8.8.8.8", "2606:4700:4700::1111", "api.example"])
|
||||
def test_public_hosts_warn(caplog, host):
|
||||
with caplog.at_level(logging.WARNING):
|
||||
lookup(host)
|
||||
assert len(leaks(caplog)) == 1
|
||||
|
||||
|
||||
@pytest.mark.parametrize(("address", "warns"), [(("ws.example", 443), True), (("203.0.113.9", 443), False)])
|
||||
def test_raw_socket_connect_to_a_host_name_warns(caplog, address, warns):
|
||||
"""A connect to a host name looks it up in C, with no getaddrinfo event; an IP address had its lookup."""
|
||||
@@ -181,13 +174,6 @@ def test_a_reloaded_service_class_uses_the_proxy_of_its_own_run(caplog):
|
||||
assert "leak.example" in leaks(caplog)[0]
|
||||
|
||||
|
||||
def test_a_subclass_of_the_service_uses_the_proxy_of_its_own_run(caplog):
|
||||
sub = type("Sub", (Svc,), {})
|
||||
with caplog.at_level(logging.WARNING):
|
||||
sub().lookup("direct.example")
|
||||
assert leaks(caplog) == []
|
||||
|
||||
|
||||
def test_a_helper_session_without_proxy_does_not_hide_a_leak(caplog):
|
||||
"""A helper class of the service is not the service instance, so the proxy of the run still decides."""
|
||||
with caplog.at_level(logging.WARNING):
|
||||
@@ -260,17 +246,6 @@ def test_rnet_session_without_proxy_warns(caplog, kwargs, exempt, warns):
|
||||
assert bool(leaks(caplog)) is warns
|
||||
|
||||
|
||||
def test_a_failing_check_never_fails_the_request(monkeypatch):
|
||||
def broken(*args):
|
||||
raise RuntimeError("dictionary changed size during iteration")
|
||||
|
||||
monkeypatch.setattr(run_proxy, "check", broken)
|
||||
session = RnetSession()
|
||||
session.ensure_client = NoNetwork # type: ignore[method-assign]
|
||||
with pytest.raises(Sent):
|
||||
session.get("https://api.example/x", max_retries=0)
|
||||
|
||||
|
||||
def test_core_parser_without_a_session_uses_the_run_proxy(monkeypatch):
|
||||
from unshackle.core.manifests import DASH
|
||||
|
||||
|
||||
Reference in New Issue
Block a user