Добавлен yandex geosuggest
This commit is contained in:
@@ -0,0 +1,266 @@
|
||||
import asyncio
|
||||
from typing import Any
|
||||
|
||||
import httpx
|
||||
import pytest
|
||||
|
||||
from app.adapters.address_suggestions.yandex_geosuggest.client import (
|
||||
YandexGeosuggestAddressSuggestionProvider,
|
||||
YandexGeosuggestClientError,
|
||||
YandexGeosuggestRequestError,
|
||||
)
|
||||
from app.config import YandexGeosuggestAddressSuggestionsConfig
|
||||
from app.schemas.request import AddressSuggestRequest
|
||||
from app.schemas.response import AddressSuggestion
|
||||
|
||||
|
||||
class SequenceHTTPClient:
|
||||
def __init__(self, results: list[Any]) -> None:
|
||||
self._results = results
|
||||
self.calls: list[dict[str, Any]] = []
|
||||
|
||||
def _next_result(self) -> Any:
|
||||
return self._results[len(self.calls) - 1]
|
||||
|
||||
async def get(
|
||||
self,
|
||||
url: str,
|
||||
*,
|
||||
params: dict[str, Any] | None = None,
|
||||
timeout: float | None = None,
|
||||
) -> httpx.Response:
|
||||
self.calls.append(
|
||||
{
|
||||
"method": "GET",
|
||||
"url": url,
|
||||
"params": params,
|
||||
"timeout": timeout,
|
||||
}
|
||||
)
|
||||
result = self._next_result()
|
||||
if isinstance(result, Exception):
|
||||
raise result
|
||||
return result
|
||||
|
||||
|
||||
def _make_request(**overrides: object) -> AddressSuggestRequest:
|
||||
payload: dict[str, object] = {
|
||||
"country_code": "AM",
|
||||
"city": "Yerevan",
|
||||
"query": "Tumanyan 12",
|
||||
"limit": 5,
|
||||
}
|
||||
payload.update(overrides)
|
||||
return AddressSuggestRequest(**payload)
|
||||
|
||||
|
||||
def test_yandex_geosuggest_provider_maps_response_to_unified_model() -> None:
|
||||
response = httpx.Response(
|
||||
200,
|
||||
json={
|
||||
"results": [
|
||||
{
|
||||
"title": {"text": "Tumanyan Street, 12, Yerevan"},
|
||||
"address": {
|
||||
"formatted_address": "Tumanyan Street, 12, apt 34, Yerevan",
|
||||
"component": [
|
||||
{"name": "Tumanyan Street", "kind": ["STREET"]},
|
||||
{"name": "12", "kind": ["HOUSE"]},
|
||||
{"name": "34", "kind": ["APARTMENT"]},
|
||||
{"name": "0001", "kind": ["POSTAL_CODE"]},
|
||||
],
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
request=httpx.Request(
|
||||
"GET",
|
||||
"https://suggest-maps.yandex.test/v1/suggest",
|
||||
),
|
||||
)
|
||||
http_client = SequenceHTTPClient([response])
|
||||
provider = YandexGeosuggestAddressSuggestionProvider(
|
||||
http_client=http_client, # type: ignore[arg-type]
|
||||
url="https://suggest-maps.yandex.test/v1/suggest",
|
||||
api_key="test-api-key",
|
||||
timeout_seconds=6.5,
|
||||
)
|
||||
|
||||
result = asyncio.run(provider.suggest(_make_request()))
|
||||
|
||||
assert result == [
|
||||
AddressSuggestion(
|
||||
address="Tumanyan Street, 12, apt 34, Yerevan",
|
||||
street="Tumanyan Street",
|
||||
house="12",
|
||||
flat="34",
|
||||
postal_code=None,
|
||||
)
|
||||
]
|
||||
assert http_client.calls == [
|
||||
{
|
||||
"method": "GET",
|
||||
"url": "https://suggest-maps.yandex.test/v1/suggest",
|
||||
"params": {
|
||||
"apikey": "test-api-key",
|
||||
"text": "Yerevan Tumanyan 12",
|
||||
"print_address": 1,
|
||||
"results": 5,
|
||||
},
|
||||
"timeout": 6.5,
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
def test_yandex_geosuggest_provider_uses_config_factory_and_omits_results_without_limit() -> None:
|
||||
response = httpx.Response(
|
||||
200,
|
||||
json={
|
||||
"results": [
|
||||
{
|
||||
"title": {"text": "Republic Square, Yerevan"},
|
||||
"address": {
|
||||
"formatted_address": "Republic Square, Yerevan",
|
||||
"component": [
|
||||
{"name": "Republic Square", "kind": ["street"]},
|
||||
],
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
request=httpx.Request(
|
||||
"GET",
|
||||
"https://suggest-maps.yandex.test/v1/suggest",
|
||||
),
|
||||
)
|
||||
http_client = SequenceHTTPClient([response])
|
||||
provider = YandexGeosuggestAddressSuggestionProvider.from_config(
|
||||
http_client=http_client, # type: ignore[arg-type]
|
||||
config=YandexGeosuggestAddressSuggestionsConfig(
|
||||
url="https://suggest-maps.yandex.test/v1/suggest",
|
||||
api_key="config-api-key",
|
||||
timeout_seconds=4.5,
|
||||
),
|
||||
)
|
||||
|
||||
result = asyncio.run(
|
||||
provider.suggest(
|
||||
_make_request(
|
||||
query="Republic Square",
|
||||
limit=None,
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
assert result == [
|
||||
AddressSuggestion(
|
||||
address="Republic Square, Yerevan",
|
||||
street="Republic Square",
|
||||
)
|
||||
]
|
||||
assert http_client.calls == [
|
||||
{
|
||||
"method": "GET",
|
||||
"url": "https://suggest-maps.yandex.test/v1/suggest",
|
||||
"params": {
|
||||
"apikey": "config-api-key",
|
||||
"text": "Yerevan Republic Square",
|
||||
"print_address": 1,
|
||||
},
|
||||
"timeout": 4.5,
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
def test_yandex_geosuggest_provider_maps_400_to_request_error() -> None:
|
||||
response = httpx.Response(
|
||||
400,
|
||||
json={"error": "bad request"},
|
||||
request=httpx.Request(
|
||||
"GET",
|
||||
"https://suggest-maps.yandex.test/v1/suggest",
|
||||
),
|
||||
)
|
||||
http_client = SequenceHTTPClient([response])
|
||||
provider = YandexGeosuggestAddressSuggestionProvider(
|
||||
http_client=http_client, # type: ignore[arg-type]
|
||||
url="https://suggest-maps.yandex.test/v1/suggest",
|
||||
api_key="test-api-key",
|
||||
)
|
||||
|
||||
with pytest.raises(YandexGeosuggestRequestError, match="status 400"):
|
||||
asyncio.run(provider.suggest(_make_request()))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("status_code", [403, 429, 503])
|
||||
def test_yandex_geosuggest_provider_maps_unavailable_statuses_to_client_error(
|
||||
status_code: int,
|
||||
) -> None:
|
||||
response = httpx.Response(
|
||||
status_code,
|
||||
json={"error": "provider error"},
|
||||
request=httpx.Request(
|
||||
"GET",
|
||||
"https://suggest-maps.yandex.test/v1/suggest",
|
||||
),
|
||||
)
|
||||
http_client = SequenceHTTPClient([response])
|
||||
provider = YandexGeosuggestAddressSuggestionProvider(
|
||||
http_client=http_client, # type: ignore[arg-type]
|
||||
url="https://suggest-maps.yandex.test/v1/suggest",
|
||||
api_key="test-api-key",
|
||||
)
|
||||
|
||||
with pytest.raises(YandexGeosuggestClientError, match=f"status {status_code}"):
|
||||
asyncio.run(provider.suggest(_make_request()))
|
||||
|
||||
|
||||
def test_yandex_geosuggest_provider_maps_transport_error_to_client_error() -> None:
|
||||
transport_error = httpx.ReadTimeout(
|
||||
"read timeout",
|
||||
request=httpx.Request(
|
||||
"GET",
|
||||
"https://suggest-maps.yandex.test/v1/suggest",
|
||||
),
|
||||
)
|
||||
http_client = SequenceHTTPClient([transport_error])
|
||||
provider = YandexGeosuggestAddressSuggestionProvider(
|
||||
http_client=http_client, # type: ignore[arg-type]
|
||||
url="https://suggest-maps.yandex.test/v1/suggest",
|
||||
api_key="test-api-key",
|
||||
)
|
||||
|
||||
with pytest.raises(YandexGeosuggestClientError, match="request failed"):
|
||||
asyncio.run(provider.suggest(_make_request()))
|
||||
|
||||
|
||||
def test_yandex_geosuggest_provider_raises_on_invalid_payload_shape() -> None:
|
||||
response = httpx.Response(
|
||||
200,
|
||||
json={
|
||||
"results": [
|
||||
{
|
||||
"address": {
|
||||
"formatted_address": "Tumanyan Street, 12, Yerevan",
|
||||
"component": [{"name": 12, "kind": ["HOUSE"]}],
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
request=httpx.Request(
|
||||
"GET",
|
||||
"https://suggest-maps.yandex.test/v1/suggest",
|
||||
),
|
||||
)
|
||||
http_client = SequenceHTTPClient([response])
|
||||
provider = YandexGeosuggestAddressSuggestionProvider(
|
||||
http_client=http_client, # type: ignore[arg-type]
|
||||
url="https://suggest-maps.yandex.test/v1/suggest",
|
||||
api_key="test-api-key",
|
||||
)
|
||||
|
||||
with pytest.raises(
|
||||
YandexGeosuggestClientError,
|
||||
match="response payload is invalid",
|
||||
):
|
||||
asyncio.run(provider.suggest(_make_request()))
|
||||
@@ -18,9 +18,14 @@ adapter:
|
||||
address_suggestions:
|
||||
country_to_provider:
|
||||
RU: "dadata"
|
||||
AM: "yandex_geosuggest"
|
||||
dadata:
|
||||
url: "https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address"
|
||||
api_key: "default-dadata-key"
|
||||
yandex_geosuggest:
|
||||
url: "https://suggest-maps.yandex.ru/v1/suggest"
|
||||
api_key: "default-yandex-key"
|
||||
timeout_seconds: 4.0
|
||||
|
||||
observability:
|
||||
enabled: false
|
||||
|
||||
@@ -18,11 +18,15 @@ adapter:
|
||||
address_suggestions:
|
||||
country_to_provider:
|
||||
RU: "dadata"
|
||||
AM: "europe"
|
||||
AM: "yandex_geosuggest"
|
||||
dadata:
|
||||
url: "https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address"
|
||||
api_key: "override-dadata-key"
|
||||
timeout_seconds: 3.0
|
||||
yandex_geosuggest:
|
||||
url: "https://suggest-maps.yandex.ru/v1/suggest"
|
||||
api_key: "override-yandex-key"
|
||||
timeout_seconds: 4.5
|
||||
|
||||
observability:
|
||||
enabled: true
|
||||
|
||||
@@ -85,6 +85,13 @@ def test_configuration_sections_are_loaded_from_yaml_file(
|
||||
"RU": "dadata",
|
||||
"BY": "dadata",
|
||||
"KZ": "dadata",
|
||||
"AM": "yandex_geosuggest",
|
||||
"AZ": "yandex_geosuggest",
|
||||
"KG": "yandex_geosuggest",
|
||||
"MD": "yandex_geosuggest",
|
||||
"TJ": "yandex_geosuggest",
|
||||
"TM": "yandex_geosuggest",
|
||||
"UZ": "yandex_geosuggest",
|
||||
}
|
||||
assert (
|
||||
settings.address_suggestions.dadata.url
|
||||
@@ -92,6 +99,15 @@ def test_configuration_sections_are_loaded_from_yaml_file(
|
||||
)
|
||||
assert settings.address_suggestions.dadata.api_key == "test-dadata-api-key"
|
||||
assert settings.address_suggestions.dadata.timeout_seconds == 7.5
|
||||
assert (
|
||||
settings.address_suggestions.yandex_geosuggest.url
|
||||
== "https://suggest-maps.yandex.ru/v1/suggest"
|
||||
)
|
||||
assert (
|
||||
settings.address_suggestions.yandex_geosuggest.api_key
|
||||
== "test-yandex-geosuggest-api-key"
|
||||
)
|
||||
assert settings.address_suggestions.yandex_geosuggest.timeout_seconds == 6.5
|
||||
assert settings.observability.enabled is False
|
||||
assert settings.observability.service_name == "g2s-aggregator-test"
|
||||
assert settings.observability.otlp_endpoint == "http://localhost:4317"
|
||||
@@ -161,10 +177,12 @@ def test_get_settings_uses_config_test_yaml_in_pytest_environment(
|
||||
assert settings.adapter.cdek_client_id == "test-id"
|
||||
assert settings.address_suggestions.country_to_provider == {
|
||||
"RU": "dadata",
|
||||
"AM": "europe",
|
||||
"AM": "yandex_geosuggest",
|
||||
}
|
||||
assert settings.address_suggestions.dadata.api_key == "override-dadata-key"
|
||||
assert settings.address_suggestions.dadata.timeout_seconds == 3.0
|
||||
assert settings.address_suggestions.yandex_geosuggest.api_key == "override-yandex-key"
|
||||
assert settings.address_suggestions.yandex_geosuggest.timeout_seconds == 4.5
|
||||
assert settings.observability.enabled is True
|
||||
assert settings.observability.service_name == "override-config-service"
|
||||
assert settings.observability.otlp_endpoint == "http://override-collector:4317"
|
||||
|
||||
@@ -35,13 +35,15 @@ def _install_service_override(app, service: StubAggregatorService) -> None:
|
||||
app.dependency_overrides[get_aggregator_service] = override_service
|
||||
|
||||
|
||||
def _valid_payload() -> dict[str, object]:
|
||||
return {
|
||||
def _valid_payload(**overrides: object) -> dict[str, object]:
|
||||
payload = {
|
||||
"country_code": "RU",
|
||||
"city": "Moscow",
|
||||
"query": "Lenina",
|
||||
"limit": 5,
|
||||
}
|
||||
payload.update(overrides)
|
||||
return payload
|
||||
|
||||
|
||||
def test_post_address_suggest_uses_registered_provider_in_default_dependency(
|
||||
@@ -62,24 +64,16 @@ def test_post_address_suggest_uses_registered_provider_in_default_dependency(
|
||||
return cls()
|
||||
|
||||
class StubAddressProvider:
|
||||
name = "dadata"
|
||||
|
||||
def __init__(self) -> None:
|
||||
def __init__(self, name: str, response: list[AddressSuggestion]) -> None:
|
||||
self.name = name
|
||||
self._response = response
|
||||
self.calls: list[AddressSuggestRequest] = []
|
||||
|
||||
async def suggest(
|
||||
self, request: AddressSuggestRequest
|
||||
) -> list[AddressSuggestion]:
|
||||
self.calls.append(request)
|
||||
return [
|
||||
AddressSuggestion(
|
||||
address="107241, Moscow, Khabarovskaya 1",
|
||||
street="Khabarovskaya",
|
||||
house="1",
|
||||
flat="25",
|
||||
postal_code="107241",
|
||||
)
|
||||
]
|
||||
return self._response
|
||||
|
||||
class StubDadataAddressSuggestionProvider:
|
||||
@classmethod
|
||||
@@ -91,7 +85,19 @@ def test_post_address_suggest_uses_registered_provider_in_default_dependency(
|
||||
) -> StubAddressProvider:
|
||||
assert http_client is stub_http_client
|
||||
_ = config
|
||||
return stub_address_provider
|
||||
return stub_dadata_provider
|
||||
|
||||
class StubYandexGeosuggestAddressSuggestionProvider:
|
||||
@classmethod
|
||||
def from_config(
|
||||
cls,
|
||||
*,
|
||||
http_client,
|
||||
config,
|
||||
) -> StubAddressProvider:
|
||||
assert http_client is stub_http_client
|
||||
_ = config
|
||||
return stub_yandex_provider
|
||||
|
||||
class StubCache:
|
||||
async def get(self, key: str) -> object | None:
|
||||
@@ -110,7 +116,28 @@ def test_post_address_suggest_uses_registered_provider_in_default_dependency(
|
||||
return StubCache()
|
||||
|
||||
stub_http_client = StubHttpClient()
|
||||
stub_address_provider = StubAddressProvider()
|
||||
stub_dadata_provider = StubAddressProvider(
|
||||
"dadata",
|
||||
[
|
||||
AddressSuggestion(
|
||||
address="107241, Moscow, Khabarovskaya 1",
|
||||
street="Khabarovskaya",
|
||||
house="1",
|
||||
flat="25",
|
||||
postal_code="107241",
|
||||
)
|
||||
],
|
||||
)
|
||||
stub_yandex_provider = StubAddressProvider(
|
||||
"yandex_geosuggest",
|
||||
[
|
||||
AddressSuggestion(
|
||||
address="Tumanyan Street, 12, Yerevan",
|
||||
street="Tumanyan Street",
|
||||
house="12",
|
||||
)
|
||||
],
|
||||
)
|
||||
http_client_timeouts: list[float] = []
|
||||
|
||||
def fake_build_controller_http_client(timeout_seconds: float) -> StubHttpClient:
|
||||
@@ -128,9 +155,19 @@ def test_post_address_suggest_uses_registered_provider_in_default_dependency(
|
||||
"DadataAddressSuggestionProvider",
|
||||
StubDadataAddressSuggestionProvider,
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
delivery_controller,
|
||||
"YandexGeosuggestAddressSuggestionProvider",
|
||||
StubYandexGeosuggestAddressSuggestionProvider,
|
||||
)
|
||||
monkeypatch.setattr(delivery_controller, "PriceCache", StubPriceCache)
|
||||
|
||||
app = create_app()
|
||||
request_payload = _valid_payload(
|
||||
country_code="AM",
|
||||
city="Yerevan",
|
||||
query="Tumanyan 12",
|
||||
)
|
||||
|
||||
async def run_request() -> httpx.Response:
|
||||
transport = httpx.ASGITransport(app=app)
|
||||
@@ -140,7 +177,7 @@ def test_post_address_suggest_uses_registered_provider_in_default_dependency(
|
||||
) as client:
|
||||
return await client.post(
|
||||
"/api/v1/delivery/suggest-address",
|
||||
json=_valid_payload(),
|
||||
json=request_payload,
|
||||
)
|
||||
|
||||
response = asyncio.run(run_request())
|
||||
@@ -148,15 +185,16 @@ def test_post_address_suggest_uses_registered_provider_in_default_dependency(
|
||||
assert response.status_code == 200
|
||||
assert response.json() == [
|
||||
{
|
||||
"address": "107241, Moscow, Khabarovskaya 1",
|
||||
"street": "Khabarovskaya",
|
||||
"house": "1",
|
||||
"flat": "25",
|
||||
"postal_code": "107241",
|
||||
"address": "Tumanyan Street, 12, Yerevan",
|
||||
"street": "Tumanyan Street",
|
||||
"house": "12",
|
||||
"flat": None,
|
||||
"postal_code": None,
|
||||
}
|
||||
]
|
||||
assert http_client_timeouts == [10.0]
|
||||
assert stub_address_provider.calls == [AddressSuggestRequest(**_valid_payload())]
|
||||
assert stub_dadata_provider.calls == []
|
||||
assert stub_yandex_provider.calls == [AddressSuggestRequest(**request_payload)]
|
||||
|
||||
|
||||
def test_post_address_suggest_returns_response_and_delegates_to_service() -> None:
|
||||
|
||||
@@ -15,6 +15,9 @@ from app.services.aggregator import (
|
||||
UnsupportedAddressSuggestionCountryError,
|
||||
)
|
||||
|
||||
_DADATA_COUNTRIES = ("RU", "BY", "KZ")
|
||||
_YANDEX_COUNTRIES = ("AM", "AZ", "KG", "MD", "TJ", "TM", "UZ")
|
||||
|
||||
|
||||
class StubAddressSuggestionProvider:
|
||||
def __init__(
|
||||
@@ -64,7 +67,20 @@ def _make_suggestion(
|
||||
)
|
||||
|
||||
|
||||
def test_suggest_addresses_routes_ru_to_dadata() -> None:
|
||||
def _make_country_mapping() -> dict[str, str]:
|
||||
return {
|
||||
**{country_code: "dadata" for country_code in _DADATA_COUNTRIES},
|
||||
**{
|
||||
country_code: "yandex_geosuggest"
|
||||
for country_code in _YANDEX_COUNTRIES
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("country_code", _DADATA_COUNTRIES)
|
||||
def test_suggest_addresses_routes_dadata_countries_to_dadata(
|
||||
country_code: str,
|
||||
) -> None:
|
||||
dadata = StubAddressSuggestionProvider(
|
||||
"dadata",
|
||||
response=[
|
||||
@@ -77,16 +93,20 @@ def test_suggest_addresses_routes_ru_to_dadata() -> None:
|
||||
)
|
||||
],
|
||||
)
|
||||
europe = StubAddressSuggestionProvider(
|
||||
"europe",
|
||||
yandex_geosuggest = StubAddressSuggestionProvider(
|
||||
"yandex_geosuggest",
|
||||
response=[_make_suggestion("Yerevan, Tumanyan 1")],
|
||||
)
|
||||
service = AggregatorService(
|
||||
providers=[],
|
||||
address_suggestion_providers=[dadata, europe],
|
||||
address_suggestion_country_to_provider={"RU": "dadata", "AM": "europe"},
|
||||
address_suggestion_providers=[dadata, yandex_geosuggest],
|
||||
address_suggestion_country_to_provider=_make_country_mapping(),
|
||||
)
|
||||
request = _make_request(
|
||||
country_code=country_code,
|
||||
city="Moscow",
|
||||
query="Khabarovskaya",
|
||||
)
|
||||
request = _make_request(country_code="RU", city="Moscow", query="Khabarovskaya")
|
||||
|
||||
result = asyncio.run(service.suggest_addresses(request))
|
||||
|
||||
@@ -100,30 +120,33 @@ def test_suggest_addresses_routes_ru_to_dadata() -> None:
|
||||
)
|
||||
]
|
||||
assert dadata.calls == [request]
|
||||
assert europe.calls == []
|
||||
assert yandex_geosuggest.calls == []
|
||||
|
||||
|
||||
def test_suggest_addresses_routes_second_provider_by_country_mapping() -> None:
|
||||
@pytest.mark.parametrize("country_code", _YANDEX_COUNTRIES)
|
||||
def test_suggest_addresses_routes_cis_countries_to_yandex_geosuggest(
|
||||
country_code: str,
|
||||
) -> None:
|
||||
dadata = StubAddressSuggestionProvider(
|
||||
"dadata",
|
||||
response=[_make_suggestion("Moscow, Lenina 1")],
|
||||
)
|
||||
europe = StubAddressSuggestionProvider(
|
||||
"europe",
|
||||
yandex_geosuggest = StubAddressSuggestionProvider(
|
||||
"yandex_geosuggest",
|
||||
response=[_make_suggestion("Yerevan, Tumanyan 1")],
|
||||
)
|
||||
service = AggregatorService(
|
||||
providers=[],
|
||||
address_suggestion_providers=[dadata, europe],
|
||||
address_suggestion_country_to_provider={"RU": "dadata", "AM": "europe"},
|
||||
address_suggestion_providers=[dadata, yandex_geosuggest],
|
||||
address_suggestion_country_to_provider=_make_country_mapping(),
|
||||
)
|
||||
request = _make_request(country_code="AM", city="Yerevan", query="Tumanyan")
|
||||
request = _make_request(country_code=country_code, city="Yerevan", query="Tumanyan")
|
||||
|
||||
result = asyncio.run(service.suggest_addresses(request))
|
||||
|
||||
assert result == [AddressSuggestion(address="Yerevan, Tumanyan 1")]
|
||||
assert dadata.calls == []
|
||||
assert europe.calls == [request]
|
||||
assert yandex_geosuggest.calls == [request]
|
||||
|
||||
|
||||
def test_suggest_addresses_raises_for_unsupported_country() -> None:
|
||||
@@ -155,7 +178,7 @@ def test_suggest_addresses_raises_for_unregistered_provider_mapping() -> None:
|
||||
response=[_make_suggestion("Moscow, Lenina 1")],
|
||||
)
|
||||
],
|
||||
address_suggestion_country_to_provider={"AM": "europe"},
|
||||
address_suggestion_country_to_provider={"AM": "yandex_geosuggest"},
|
||||
)
|
||||
|
||||
with pytest.raises(UnsupportedAddressSuggestionCountryError):
|
||||
|
||||
Reference in New Issue
Block a user