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
-38
View File
@@ -10,13 +10,6 @@ from unshackle.core.remote_service import resolve_proxy_arg, resolve_server
pytestmark = pytest.mark.unit
@pytest.fixture
def empty_remote_services(monkeypatch: pytest.MonkeyPatch) -> None:
from unshackle.core import remote_service as rs
monkeypatch.setattr(rs.config, "remote_services", {})
@pytest.fixture
def single_remote_service(monkeypatch: pytest.MonkeyPatch) -> None:
from unshackle.core import remote_service as rs
@@ -49,11 +42,6 @@ def multi_remote_services(monkeypatch: pytest.MonkeyPatch) -> None:
)
def test_resolve_server_default_auth_headers(single_remote_service) -> None:
_, _, services = resolve_server("primary")
assert services["_auth_headers"] == ["X-Secret-Key", "X-Api-Key"]
def test_resolve_server_custom_auth_headers_extend_defaults(monkeypatch: pytest.MonkeyPatch) -> None:
from unshackle.core import remote_service as rs
@@ -86,12 +74,6 @@ def test_resolve_server_bad_auth_headers_raises(monkeypatch: pytest.MonkeyPatch,
assert "auth_headers" in str(exc.value.message)
def test_resolve_server_no_config_raises_click(empty_remote_services) -> None:
with pytest.raises(click.ClickException) as exc:
resolve_server(None)
assert "remote_services" in str(exc.value.message)
def test_resolve_server_single_picks_only_entry(single_remote_service) -> None:
url, key, services = resolve_server(None)
assert url == "https://primary:8080"
@@ -100,12 +82,6 @@ def test_resolve_server_single_picks_only_entry(single_remote_service) -> None:
assert services.get("EXAMPLE") is True
def test_resolve_server_explicit_name(single_remote_service) -> None:
url, key, services = resolve_server("primary")
assert url == "https://primary:8080"
assert services["_server_cdm"] is True
def test_resolve_server_unknown_name_raises(single_remote_service) -> None:
with pytest.raises(click.ClickException) as exc:
resolve_server("bogus")
@@ -125,20 +101,6 @@ def test_resolve_server_multi_with_name(multi_remote_services) -> None:
assert services["_server_cdm"] is None
def test_resolve_proxy_none_returns_none() -> None:
assert resolve_proxy_arg(None) is None
assert resolve_proxy_arg("") is None
def test_resolve_proxy_passes_through_value(monkeypatch: pytest.MonkeyPatch) -> None:
import unshackle.core.proxies.resolve as resolve_mod
monkeypatch.setattr(resolve_mod, "initialize_proxy_providers", lambda: [])
monkeypatch.setattr(resolve_mod, "resolve_proxy", lambda arg, providers: f"http://proxy/{arg}")
assert resolve_proxy_arg("us") == "http://proxy/us"
def test_resolve_proxy_value_error_becomes_click(monkeypatch: pytest.MonkeyPatch) -> None:
import unshackle.core.proxies.resolve as resolve_mod