Добавлено сохранение заказов в postgres
This commit is contained in:
@@ -21,6 +21,9 @@ tbank_payment:
|
||||
terminal_key: "yaml-terminal-key"
|
||||
password: "yaml-password"
|
||||
|
||||
postgres:
|
||||
dsn: "postgresql+asyncpg://postgres:postgres@localhost:5432/default"
|
||||
|
||||
address_suggestions:
|
||||
country_to_provider:
|
||||
RU: "dadata"
|
||||
|
||||
@@ -29,6 +29,9 @@ tbank_payment:
|
||||
terminal_key: "test-terminal-key"
|
||||
password: "test-password"
|
||||
|
||||
postgres:
|
||||
dsn: "postgresql+asyncpg://postgres:postgres@localhost:5432/invalid_price"
|
||||
|
||||
address_suggestions:
|
||||
country_to_provider:
|
||||
RU: "dadata"
|
||||
|
||||
@@ -18,6 +18,9 @@ tbank_payment:
|
||||
terminal_key: "test-terminal-key"
|
||||
password: "test-password"
|
||||
|
||||
postgres:
|
||||
dsn: "postgresql+asyncpg://postgres:postgres@localhost:5432/missing_adapter"
|
||||
|
||||
address_suggestions:
|
||||
country_to_provider:
|
||||
RU: "dadata"
|
||||
|
||||
@@ -29,6 +29,9 @@ tbank_payment:
|
||||
terminal_key: "test-terminal-key"
|
||||
password: "test-password"
|
||||
|
||||
postgres:
|
||||
dsn: "postgresql+asyncpg://postgres:postgres@localhost:5432/missing_address"
|
||||
|
||||
observability:
|
||||
enabled: false
|
||||
service_name: "missing-address-suggestions-service"
|
||||
|
||||
@@ -29,6 +29,9 @@ tbank_payment:
|
||||
terminal_key: "test-terminal-key"
|
||||
password: "test-password"
|
||||
|
||||
postgres:
|
||||
dsn: "postgresql+asyncpg://postgres:postgres@localhost:5432/missing_observability"
|
||||
|
||||
address_suggestions:
|
||||
country_to_provider:
|
||||
RU: "dadata"
|
||||
|
||||
@@ -29,6 +29,9 @@ tbank_payment:
|
||||
terminal_key: "test-terminal-key"
|
||||
password: "test-password"
|
||||
|
||||
postgres:
|
||||
dsn: "postgresql+asyncpg://postgres:postgres@localhost:5432/missing_observability_endpoint"
|
||||
|
||||
address_suggestions:
|
||||
country_to_provider:
|
||||
RU: "dadata"
|
||||
|
||||
@@ -28,6 +28,9 @@ tbank_payment:
|
||||
terminal_key: "test-terminal-key"
|
||||
password: "test-password"
|
||||
|
||||
postgres:
|
||||
dsn: "postgresql+asyncpg://postgres:postgres@localhost:5432/missing_price"
|
||||
|
||||
address_suggestions:
|
||||
country_to_provider:
|
||||
RU: "dadata"
|
||||
|
||||
@@ -24,6 +24,9 @@ tbank_payment:
|
||||
retry_attempts: 1
|
||||
retry_backoff_seconds: 0.05
|
||||
|
||||
postgres:
|
||||
dsn: "postgresql+asyncpg://postgres:postgres@localhost:5432/override"
|
||||
|
||||
address_suggestions:
|
||||
country_to_provider:
|
||||
RU: "dadata"
|
||||
|
||||
@@ -132,6 +132,10 @@ def test_configuration_sections_are_loaded_from_yaml_file(
|
||||
assert settings.tbank_payment.timeout_seconds == 10.0
|
||||
assert settings.tbank_payment.retry_attempts == 2
|
||||
assert settings.tbank_payment.retry_backoff_seconds == 0.2
|
||||
assert (
|
||||
settings.postgres.dsn
|
||||
== "postgresql+asyncpg://postgres:postgres@localhost:5432/g2s_aggregator_test"
|
||||
)
|
||||
assert settings.address_suggestions.country_to_provider == _expected_country_mapping()
|
||||
assert (
|
||||
settings.address_suggestions.dadata.url
|
||||
@@ -199,6 +203,7 @@ def test_get_settings_returns_cached_instance(monkeypatch: pytest.MonkeyPatch) -
|
||||
assert first.service.provider_timeout_seconds == 10.0
|
||||
assert first.business_logic.provider_price_multiplier == Decimal("1.0")
|
||||
assert first.tbank_payment.auth.terminal_key == "test-terminal-key"
|
||||
assert first.postgres.dsn.endswith("/g2s_aggregator_test")
|
||||
assert first.address_suggestions.country_to_provider["RU"] == "dadata"
|
||||
assert first.observability.service_name == "g2s-aggregator-test"
|
||||
get_settings.cache_clear()
|
||||
@@ -224,6 +229,10 @@ def test_get_settings_uses_config_test_yaml_in_pytest_environment(
|
||||
assert settings.tbank_payment.timeout_seconds == 4.25
|
||||
assert settings.tbank_payment.retry_attempts == 1
|
||||
assert settings.tbank_payment.retry_backoff_seconds == 0.05
|
||||
assert (
|
||||
settings.postgres.dsn
|
||||
== "postgresql+asyncpg://postgres:postgres@localhost:5432/override"
|
||||
)
|
||||
assert settings.address_suggestions.country_to_provider == {
|
||||
"RU": "dadata",
|
||||
"AM": "yandex_geosuggest",
|
||||
|
||||
Reference in New Issue
Block a user