add: characterization tests for the four kept provider imports #135
Loading…
Reference in a new issue
No description provided.
Delete branch "add/provider-parsing-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
#23 gates the provider base-class refactor on the parsing having test coverage — the six routines encode undocumented API knowledge (AirVPN's RSA+AES handshake, Windscribe's CSRF login, Mullvad's scraped table) that a blind refactor would lose. None of it was tested.
Fix
Characterization tests for the four providers #134 keeps: Airvpn, Mullvad, Windscribe, ProtonVPN. A
FakeRequests/FakeSessionpair stands in for the requests surfaceupdateactually uses; dig and iptables are stubbed. Fixtures are trimmed live captures (2026-08-24) of the two still-public endpoints (Mullvad WG relay list, Windscribe server list); everything the live services no longer serve or keep behind credentials is synthetic, shaped by what the parsers read. The Airvpn fake encrypts its replies with the AES key the thread generates, so the real decrypt path runs.Deliberately pinned quirks, so the refactor preserves or knowingly changes them: Windscribe's ip←ip2/ip2←ip3 field offset and trailing-space city names, Mullvad's legacy OpenVPN protocol table, and today's two live failures (Mullvad's table-less servers page, Windscribe's 404ing cert bundle) each ending as a reported failed import rather than a crash (#32).
Verification
pytest— 324 passed, including the 36 intests/test_update.py(14 new).ruff check --select E9,F63,F7,F82 .and the SyntaxWarning compileall gate both clean. No test needs network, root or a VPN account; the file's header promise still holds.