Skip to content

Commit

Permalink
Added scenes to tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
elahd authored Oct 27, 2023
1 parent 9ebff5d commit a53fc7e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ def _load_mocks(repeat: bool = True) -> None:
repeat=repeat,
)

response_mocker.get(
url=AttributeRegistry.get_endpoints(DeviceType.SCENE)["primary"].format(c.URL_BASE, ""),
status=200,
body=get_http_body_json("scenes_ok"),
repeat=repeat,
)

response_mocker.get(
url=AlarmController.ALL_DEVICES_URL_TEMPLATE.format(c.URL_BASE, "id-system"),
status=200,
Expand Down
4 changes: 2 additions & 2 deletions tests/responses/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
def get_http_body_json(name: str) -> str:
"""Get server/client response/request body from JSON file."""

return resources.read_text(__package__, f"{name}.json")
return resources.files(__package__).joinpath(f"{name}.json").read_text()


def get_http_body_html(name: str) -> str:
"""Get server/client response/request body from HTML file."""

return resources.read_text(__package__, f"{name}.html")
return resources.files(__package__).joinpath(f"{name}.html").read_text()
1 change: 1 addition & 0 deletions tests/test_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ async def test__device_storage(
assert adc_client.devices.lights.values()
assert adc_client.devices.thermostats.values()
assert adc_client.devices.water_sensors.values()
assert adc_client.devices.scenes.values()


@pytest.mark.asyncio
Expand Down

0 comments on commit a53fc7e

Please sign in to comment.