File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed
homeassistant/components/alexa_devices
tests/components/alexa_devices Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 55from typing import Any
66
77from aioamazondevices .api import AmazonEchoApi
8- from aioamazondevices .exceptions import CannotAuthenticate , CannotConnect
8+ from aioamazondevices .exceptions import CannotAuthenticate , CannotConnect , WrongCountry
99import voluptuous as vol
1010
1111from homeassistant .config_entries import ConfigFlow , ConfigFlowResult
@@ -36,6 +36,8 @@ async def async_step_user(
3636 errors ["base" ] = "cannot_connect"
3737 except CannotAuthenticate :
3838 errors ["base" ] = "invalid_auth"
39+ except WrongCountry :
40+ errors ["base" ] = "wrong_country"
3941 else :
4042 await self .async_set_unique_id (data ["customer_info" ]["user_id" ])
4143 self ._abort_if_unique_id_configured ()
Original file line number Diff line number Diff line change 3333 "error" : {
3434 "cannot_connect" : " [%key:common::config_flow::error::cannot_connect%]" ,
3535 "invalid_auth" : " [%key:common::config_flow::error::invalid_auth%]" ,
36+ "wrong_country" : " Wrong country selected. Please select the country where your Amazon account is registered." ,
3637 "unknown" : " [%key:common::config_flow::error::unknown%]"
3738 }
3839 },
Original file line number Diff line number Diff line change 22
33from unittest .mock import AsyncMock
44
5- from aioamazondevices .exceptions import CannotAuthenticate , CannotConnect
5+ from aioamazondevices .exceptions import CannotAuthenticate , CannotConnect , WrongCountry
66import pytest
77
88from homeassistant .components .alexa_devices .const import CONF_LOGIN_DATA , DOMAIN
@@ -57,6 +57,7 @@ async def test_full_flow(
5757 [
5858 (CannotConnect , "cannot_connect" ),
5959 (CannotAuthenticate , "invalid_auth" ),
60+ (WrongCountry , "wrong_country" ),
6061 ],
6162)
6263async def test_flow_errors (
You can’t perform that action at this time.
0 commit comments