mirror of
https://github.com/home-assistant/core.git
synced 2026-09-28 02:18:10 -04:00
Use async_load_fixture in async test functions (l-z) (#145717)
* Use async_load_fixture in async test functions (l-z) * Adjust
This commit is contained in:
@@ -14,14 +14,16 @@ from homeassistant.data_entry_flow import FlowResultType
|
||||
|
||||
from . import MOCK_FAILED_TO_LOGIN_MSG, MOCK_INVALID_TOKEN_MGS
|
||||
|
||||
from tests.common import MockConfigEntry, load_fixture
|
||||
from tests.common import MockConfigEntry, async_load_fixture
|
||||
|
||||
|
||||
@pytest.mark.parametrize("test_cucode_in_coordinator_data", [False, True])
|
||||
async def test_form(hass: HomeAssistant, test_cucode_in_coordinator_data) -> None:
|
||||
"""Test we get the form."""
|
||||
|
||||
coordinator_data = json.loads(load_fixture("switchbee.json", "switchbee"))
|
||||
coordinator_data = json.loads(
|
||||
await async_load_fixture(hass, "switchbee.json", DOMAIN)
|
||||
)
|
||||
|
||||
if test_cucode_in_coordinator_data:
|
||||
coordinator_data["data"]["cuCode"] = "300F123456"
|
||||
@@ -138,7 +140,9 @@ async def test_form_unknown_error(hass: HomeAssistant) -> None:
|
||||
async def test_form_entry_exists(hass: HomeAssistant) -> None:
|
||||
"""Test we handle an already existing entry."""
|
||||
|
||||
coordinator_data = json.loads(load_fixture("switchbee.json", "switchbee"))
|
||||
coordinator_data = json.loads(
|
||||
await async_load_fixture(hass, "switchbee.json", DOMAIN)
|
||||
)
|
||||
MockConfigEntry(
|
||||
unique_id="a8:21:08:e7:67:b6",
|
||||
domain=DOMAIN,
|
||||
|
||||
Reference in New Issue
Block a user