Correct zamg config flow comments (#81369)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com> fixes undefined
This commit is contained in:
parent
fd9124279b
commit
8ca92254b6
14 changed files with 451 additions and 112 deletions
|
@ -14,6 +14,9 @@ from tests.common import MockConfigEntry, load_fixture
|
|||
TEST_STATION_ID = "11240"
|
||||
TEST_STATION_NAME = "Graz/Flughafen"
|
||||
|
||||
TEST_STATION_ID_2 = "11035"
|
||||
TEST_STATION_NAME_2 = "WIEN/HOHE WARTE"
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_config_entry() -> MockConfigEntry:
|
||||
|
@ -67,6 +70,27 @@ def mock_zamg(request: pytest.FixtureRequest) -> Generator[None, MagicMock, None
|
|||
yield zamg
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_zamg_coordinator(
|
||||
request: pytest.FixtureRequest,
|
||||
) -> Generator[None, MagicMock, None]:
|
||||
"""Return a mocked Zamg client."""
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.zamg.coordinator.ZamgDevice", autospec=True
|
||||
) as zamg_mock:
|
||||
zamg = zamg_mock.return_value
|
||||
zamg.update.return_value = {TEST_STATION_ID: {"Name": TEST_STATION_NAME}}
|
||||
zamg.zamg_stations.return_value = {
|
||||
TEST_STATION_ID: (46.99305556, 15.43916667, TEST_STATION_NAME),
|
||||
"11244": (46.8722229, 15.90361118, "BAD GLEICHENBERG"),
|
||||
}
|
||||
zamg.closest_station.return_value = TEST_STATION_ID
|
||||
zamg.get_data.return_value = TEST_STATION_ID
|
||||
zamg.get_station_name = TEST_STATION_NAME
|
||||
yield zamg
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_zamg_stations(
|
||||
request: pytest.FixtureRequest,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue