mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix Dremel 3D printer tests (#119853)
This commit is contained in:
parent
2560d7aeda
commit
e5eef7c6dd
@ -32,23 +32,23 @@ def config_entry(hass: HomeAssistant) -> MockConfigEntry:
|
|||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def connection() -> None:
|
def connection() -> None:
|
||||||
"""Mock Dremel 3D Printer connection."""
|
"""Mock Dremel 3D Printer connection."""
|
||||||
mock = requests_mock.Mocker()
|
with requests_mock.Mocker() as mock:
|
||||||
mock.post(
|
mock.post(
|
||||||
f"http://{HOST}:80/command",
|
f"http://{HOST}:80/command",
|
||||||
response_list=[
|
response_list=[
|
||||||
{"text": load_fixture("dremel_3d_printer/command_1.json")},
|
{"text": load_fixture("dremel_3d_printer/command_1.json")},
|
||||||
{"text": load_fixture("dremel_3d_printer/command_2.json")},
|
{"text": load_fixture("dremel_3d_printer/command_2.json")},
|
||||||
{"text": load_fixture("dremel_3d_printer/command_1.json")},
|
{"text": load_fixture("dremel_3d_printer/command_1.json")},
|
||||||
{"text": load_fixture("dremel_3d_printer/command_2.json")},
|
{"text": load_fixture("dremel_3d_printer/command_2.json")},
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
mock.post(
|
mock.post(
|
||||||
f"https://{HOST}:11134/getHomeMessage",
|
f"https://{HOST}:11134/getHomeMessage",
|
||||||
text=load_fixture("dremel_3d_printer/get_home_message.json"),
|
text=load_fixture("dremel_3d_printer/get_home_message.json"),
|
||||||
status_code=HTTPStatus.OK,
|
status_code=HTTPStatus.OK,
|
||||||
)
|
)
|
||||||
mock.start()
|
yield
|
||||||
|
|
||||||
|
|
||||||
def patch_async_setup_entry():
|
def patch_async_setup_entry():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user