Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
import pathlib


def load_fixture(name):
def load_fixture(name: str) -> str:
"""Load a fixture."""
return (pathlib.Path(__file__).parent / "fixtures" / name).read_text()
18 changes: 17 additions & 1 deletion test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from zwave_js_server.client import Client
from zwave_js_server.model.controller import Controller
from zwave_js_server.model.driver import Driver
from zwave_js_server.model.node import Node
from zwave_js_server.model.node import Node, NodeDataType

from . import load_fixture
from .common import MockCommandProtocol
Expand Down Expand Up @@ -103,6 +103,22 @@ def ring_keypad_state_fixture():
return json.loads(load_fixture("ring_keypad_state.json"))


@pytest.fixture(name="shelly_wave_shutter_state", scope="session")
def shelly_wave_shutter_state_fixture() -> NodeDataType:
"""Load the shelly wave shutter node state fixture data."""
return json.loads(load_fixture("shelly_eu_wave_shutter_state.json"))


@pytest.fixture(name="shelly_wave_shutter")
def shelly_wave_shutter_fixture(
driver: Driver, shelly_wave_shutter_state: NodeDataType
) -> Node:
"""Mock a shelly wave shutter node."""
node = Node(driver.client, deepcopy(shelly_wave_shutter_state))
driver.controller.nodes[node.node_id] = node
return node


@pytest.fixture(name="endpoints_with_command_classes_state", scope="session")
def endpoints_with_command_classes_state_fixture():
"""Load the node state fixture data with command classes on the endpoint."""
Expand Down
Loading