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
16 changes: 15 additions & 1 deletion test/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Provide common pytest fixtures."""
import json
from unittest.mock import AsyncMock, patch
from typing import List, Tuple
from unittest.mock import AsyncMock, patch

import pytest
from aiohttp import ClientSession, ClientWebSocketResponse
Expand All @@ -26,6 +26,12 @@ def multisensor_6_state_fixture():
return json.loads(load_fixture("multisensor_6_state.json"))


@pytest.fixture(name="lock_schlage_be469_state", scope="session")
def lock_schlage_be469_state_fixture():
"""Load the schlage lock node state fixture data."""
return json.loads(load_fixture("lock_schlage_be469_state.json"))


@pytest.fixture(name="client_session")
def client_session_fixture():
"""Mock an aiohttp client session."""
Expand Down Expand Up @@ -112,6 +118,14 @@ def node_fixture(driver, multisensor_6_state):
return node


@pytest.fixture(name="lock_schlage_be469")
def lock_schlage_be469_fixture(driver, lock_schlage_be469_state):
"""Mock a schlage lock node."""
node = Node(driver.client, lock_schlage_be469_state)
driver.controller.nodes[node.node_id] = node
return node


@pytest.fixture(name="controller")
def controller_fixture(driver, controller_state):
"""Return a controller instance with a supporting client."""
Expand Down
Loading