test: delete slow, timing-based and redundant tests

This commit is contained in:
imSp4rky
2026-12-05 15:20:05 -07:00
parent 783a2fc185
commit 3a0a74e694
292 changed files with 153 additions and 15174 deletions
-23
View File
@@ -106,22 +106,6 @@ def test_download_with_flag_bypasses_proxy(server, monkeypatch) -> None:
assert attachment.path is not None and attachment.path.read_bytes() == BODY
def test_download_with_proxy_download_uses_only_that_proxy(server, monkeypatch) -> None:
seen: dict = {}
def fake_direct(session, proxy=None):
seen["proxy"] = proxy
return Recorder()
monkeypatch.setattr(track_module, "direct_session", fake_direct)
proxied = Recorder(proxies={"https": "http://manifest-proxy:1"})
attachment = Attachment.from_url(url(server), name="thumbnail", session=proxied)
attachment.download(proxied, proxy_download="http://dl-proxy:2")
assert not proxied.got
assert seen["proxy"] == "http://dl-proxy:2"
assert proxied.proxies == {"https": "http://manifest-proxy:1"}
def test_no_proxy_download_wins_over_proxy_download(server, monkeypatch) -> None:
seen: dict = {}
monkeypatch.setattr(track_module, "direct_session", lambda s, proxy=None: seen.setdefault("p", proxy) or Recorder())
@@ -170,13 +154,6 @@ def test_direct_session_routes_through_the_given_proxy() -> None:
assert requests.utils.select_proxy("https://cdn.example.com/a", new.proxies) == "http://dl-proxy:2"
def test_direct_session_proxy_beats_environment(monkeypatch) -> None:
monkeypatch.setenv("HTTPS_PROXY", "http://env-proxy:9")
new = track_module.direct_session(requests.Session(), "http://dl-proxy:2")
settings = new.merge_environment_settings("https://cdn.example.com/a", {}, None, None, None)
assert settings["proxies"]["https"] == "http://dl-proxy:2"
def test_direct_session_copies_rnet_cookies_set_by_name() -> None:
from unshackle.core.session import RnetSession