test(amazon): cover sticky proxy country rewrite

This commit is contained in:
Anish Sarkar 2026-07-15 15:31:48 +05:30
parent b11fcfe57e
commit e19c9b292f

View file

@ -35,6 +35,19 @@ def test_dataimpulse_sticky_url_replaces_existing_session(monkeypatch):
assert result.count("__sid.new") == 1
def test_dataimpulse_sticky_url_rewrites_country(monkeypatch):
monkeypatch.setattr(
Config,
"PROXY_URL",
"http://token__cr.us:secret@gw.dataimpulse.com:823",
)
result = DataImpulseProvider().get_sticky_proxy_url("new", "gb")
assert "token__cr.gb__sid.new" in result
assert "__cr.us" not in result
def test_dataimpulse_sticky_url_rejects_empty_session(monkeypatch):
monkeypatch.setattr(
Config,