mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-06 07:55:10 +00:00
test: delete slow, timing-based and redundant tests
This commit is contained in:
@@ -40,11 +40,6 @@ def test_bare_query_skips_the_failed_provider() -> None:
|
||||
assert uri.endswith("@us-dal.prod.surfshark.com:443")
|
||||
|
||||
|
||||
def test_query_naming_another_provider_still_works() -> None:
|
||||
uri = resolve_proxy("surfsharkvpn:us", load_proxy_providers(OTHERS))
|
||||
assert uri.endswith("@us-dal.prod.surfshark.com:443")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name", ["nordvpn", "NordVPN"])
|
||||
def test_query_naming_the_failed_provider_reports_why(name: str) -> None:
|
||||
with pytest.raises(ValueError, match="NordVPN could not load: NordVPN needs its Service Credentials"):
|
||||
@@ -156,20 +151,3 @@ def test_construction_makes_no_request_and_the_first_read_fetches_once(
|
||||
assert getattr(provider, attr) == [{"country": "US"}]
|
||||
getattr(provider, attr)
|
||||
assert calls == [1]
|
||||
|
||||
|
||||
def test_health_probe_reads_each_proxy_catalogue(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
from unshackle.core.api.handlers import run_health_checks
|
||||
|
||||
calls: list[int] = []
|
||||
|
||||
def countries() -> list[dict]:
|
||||
calls.append(1)
|
||||
return [{"serverCount": 3}]
|
||||
|
||||
monkeypatch.setattr(config, "key_vaults", [])
|
||||
monkeypatch.setattr(config, "proxy_providers", {"nordvpn": CREDENTIALS})
|
||||
monkeypatch.setattr(NordVPN, "get_countries", staticmethod(countries))
|
||||
detail = {c["id"]: c for c in run_health_checks()}["proxies"]["detail"]
|
||||
assert calls == [1]
|
||||
assert "NordVPN (1 Country (3 Servers))" in detail
|
||||
|
||||
Reference in New Issue
Block a user