Files
universal-registrar/tests/unit/test_outlook_provider_registry.py
T
reform 8044e88be4
CI / offline-tests (push) Has been cancelled
CI / web-unit-tests (push) Has been cancelled
CI / package-console10 (push) Has been cancelled
recovered from aaronjaworski710
2026-10-23 20:02:14 +03:00

41 lines
1.4 KiB
Python

import pytest
from register_core.config.schema import ProviderSpec
from register_core.providers.registry import get_provider
def test_outlook_aliases_resolve_to_the_same_provider():
providers = [get_provider(name, config={}) for name in ("outlook", "microsoft", "hotmail", "msa")]
assert {provider.name for provider in providers} == {"outlook"}
def test_outlook_options_are_non_secret_config():
spec = ProviderSpec(
name="outlook",
options={
"client_id": "synthetic-client-id",
"captcha_strategy": 2,
"temp_mail": {"base_url": "https://mail.invalid", "domain": "invalid"},
"email_suffix": "@outlook.com",
"bind_recovery_email": False,
"outlook_auths_dir": "./outlook-auths",
},
)
assert spec.name == "outlook"
assert spec.options["captcha_strategy"] == 2
def test_outlook_options_reject_inline_secret_values():
spec = ProviderSpec(name="outlook", options={"password": "synthetic-password"})
with pytest.raises(ValueError, match="secret"):
spec.outlook_options()
def test_outlook_options_reject_nested_temp_mail_secret_values():
spec = ProviderSpec(
name="outlook",
options={"temp_mail": {"admin_password": "synthetic-admin"}},
)
with pytest.raises(ValueError, match="temp_mail.admin_password"):
spec.outlook_options()