mirror of
https://github.com/feder-cr/invisible_playwright.git
synced 2026-06-28 09:29:37 +02:00
Address proxy timezone and platform docs
This commit is contained in:
parent
143aff4bd2
commit
8f0f86709d
11 changed files with 321 additions and 15 deletions
|
|
@ -81,3 +81,21 @@ def test_async_default_context_kwargs_match_sync():
|
|||
a = AsyncIP(seed=42, timezone="America/New_York", locale="de-DE")
|
||||
s = SyncIP(seed=42, timezone="America/New_York", locale="de-DE")
|
||||
assert a._default_context_kwargs() == s._default_context_kwargs()
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_async_timezone_auto_resolves_from_proxy(monkeypatch):
|
||||
calls = []
|
||||
|
||||
def fake_resolve(proxy):
|
||||
calls.append(proxy)
|
||||
return "Europe/Vienna"
|
||||
|
||||
monkeypatch.setattr("invisible_playwright.async_api.resolve_proxy_timezone", fake_resolve)
|
||||
|
||||
proxy = {"server": "socks5://host:1080"}
|
||||
ip = AsyncIP(seed=42, proxy=proxy, timezone="auto")
|
||||
|
||||
assert ip._timezone == "Europe/Vienna"
|
||||
assert ip._default_context_kwargs()["timezone_id"] == "Europe/Vienna"
|
||||
assert calls == [proxy]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue