Ejemplo n.º 1
0
import pytest
from aiohttp import ClientSession
from aioresponses import aioresponses

from renault_api.const import AVAILABLE_LOCALES
from renault_api.const import CONF_GIGYA_APIKEY
from renault_api.const import CONF_GIGYA_URL
from renault_api.const import CONF_KAMEREON_APIKEY
from renault_api.const import CONF_KAMEREON_URL
from renault_api.const import LOCALE_BASE_URL
from renault_api.exceptions import RenaultException
from renault_api.helpers import get_api_keys


@pytest.mark.asyncio
@pytest.mark.parametrize("locale", AVAILABLE_LOCALES.keys())
async def test_available_locales(locale: str) -> None:
    """Ensure all items AVAILABLE_LOCALES have correct data."""
    expected_api_keys = AVAILABLE_LOCALES[locale]

    api_keys = await get_api_keys(locale)
    assert api_keys == expected_api_keys
    for key in [
        CONF_GIGYA_APIKEY,
        CONF_GIGYA_URL,
        CONF_KAMEREON_APIKEY,
        CONF_KAMEREON_URL,
    ]:
        assert api_keys[key]