2020-03-16 02:05:10 +00:00
|
|
|
"""Configuration for Abode tests."""
|
|
|
|
import abodepy.helpers.constants as CONST
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
from tests.common import load_fixture
|
2021-03-02 08:02:04 +00:00
|
|
|
from tests.components.light.conftest import mock_light_profiles # noqa: F401
|
2020-03-16 02:05:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
2022-01-10 14:54:09 +00:00
|
|
|
def requests_mock_fixture(requests_mock) -> None:
|
2020-03-16 02:05:10 +00:00
|
|
|
"""Fixture to provide a requests mocker."""
|
|
|
|
# Mocks the login response for abodepy.
|
2021-11-02 03:47:05 +00:00
|
|
|
requests_mock.post(CONST.LOGIN_URL, text=load_fixture("login.json", "abode"))
|
2020-03-28 17:54:07 +00:00
|
|
|
# Mocks the logout response for abodepy.
|
2021-11-02 03:47:05 +00:00
|
|
|
requests_mock.post(CONST.LOGOUT_URL, text=load_fixture("logout.json", "abode"))
|
2020-03-16 02:05:10 +00:00
|
|
|
# Mocks the oauth claims response for abodepy.
|
|
|
|
requests_mock.get(
|
2021-11-02 03:47:05 +00:00
|
|
|
CONST.OAUTH_TOKEN_URL, text=load_fixture("oauth_claims.json", "abode")
|
2020-03-16 02:05:10 +00:00
|
|
|
)
|
|
|
|
# Mocks the panel response for abodepy.
|
2021-11-02 03:47:05 +00:00
|
|
|
requests_mock.get(CONST.PANEL_URL, text=load_fixture("panel.json", "abode"))
|
2020-03-16 02:05:10 +00:00
|
|
|
# Mocks the automations response for abodepy.
|
2021-11-02 03:47:05 +00:00
|
|
|
requests_mock.get(
|
|
|
|
CONST.AUTOMATION_URL, text=load_fixture("automation.json", "abode")
|
|
|
|
)
|
2020-03-16 02:05:10 +00:00
|
|
|
# Mocks the devices response for abodepy.
|
2021-11-02 03:47:05 +00:00
|
|
|
requests_mock.get(CONST.DEVICES_URL, text=load_fixture("devices.json", "abode"))
|