Compare commits
103
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
907de1aaab | ||
|
|
b7a5860bbf | ||
|
|
3a2ced07f2 | ||
|
|
fbf793c4c3 | ||
|
|
d288b706ef | ||
|
|
13a80e6af5 | ||
|
|
cb91d2f547 | ||
|
|
a11ab703b1 | ||
|
|
93ed8a4c15 | ||
|
|
70330a886d | ||
|
|
52057dff79 | ||
|
|
20575023cc | ||
|
|
8637de6b1f | ||
|
|
1033955ee1 | ||
|
|
e059bc7cc5 | ||
|
|
f85cbb043d | ||
|
|
75670b7d06 | ||
|
|
39186e56af | ||
|
|
8b3b9d380a | ||
|
|
668bd9d0bc | ||
|
|
bf76923975 | ||
|
|
f2b72debbe | ||
|
|
9f9d0e8106 | ||
|
|
871f00ebdc | ||
|
|
891cd4c4e0 | ||
|
|
3c2cd2413d | ||
|
|
227bd66972 | ||
|
|
99b07e5a7a | ||
|
|
b22ae5949b | ||
|
|
411ea16668 | ||
|
|
15c2139381 | ||
|
|
0cd664e2a6 | ||
|
|
97dd68da95 | ||
|
|
a727e061d6 | ||
|
|
a53b0f75a1 | ||
|
|
d408fbec4a | ||
|
|
48eb57ef70 | ||
|
|
0a3a92db07 | ||
|
|
a7d67066d4 | ||
|
|
123f34de02 | ||
|
|
73ff34ff9a | ||
|
|
db21a76885 | ||
|
|
5b045f8c4f | ||
|
|
6691cd0df9 | ||
|
|
d156150ef0 | ||
|
|
92ae97dc5f | ||
|
|
0037bb63fe | ||
|
|
f2a65e77b6 | ||
|
|
4701c3cd46 | ||
|
|
8457aefc77 | ||
|
|
45617d8515 | ||
|
|
59463b5f70 | ||
|
|
a3ec139da7 | ||
|
|
6f7550f085 | ||
|
|
23207e0d53 | ||
|
|
b4796efba9 | ||
|
|
3bdee78f8e | ||
|
|
c33b946cc3 | ||
|
|
2ff5a884ce | ||
|
|
17b1faf7df | ||
|
|
0f8e201567 | ||
|
|
6d01a5d62c | ||
|
|
94c21d1eea | ||
|
|
6e2def9513 | ||
|
|
f8d10d2612 | ||
|
|
56d61a8c1f | ||
|
|
6ab2f89a30 | ||
|
|
551e08ef37 | ||
|
|
616119eb09 | ||
|
|
9e26772a1a | ||
|
|
775d56196c | ||
|
|
44df9faee0 | ||
|
|
f891b56cb2 | ||
|
|
239ab126fb | ||
|
|
45e8c03424 | ||
|
|
72f0635833 | ||
|
|
3865152f5f | ||
|
|
2010ee4d02 | ||
|
|
3cdebc5097 | ||
|
|
dc7824b765 | ||
|
|
bac1074a71 | ||
|
|
20a36692e7 | ||
|
|
53f2adf129 | ||
|
|
a7c74fdf86 | ||
|
|
011400bb38 | ||
|
|
9a4a86bfea | ||
|
|
3717319711 | ||
|
|
01d25d9908 | ||
|
|
43652bc1c2 | ||
|
|
cd150f816f | ||
|
|
43e6ba2f25 | ||
|
|
f95c60fc53 | ||
|
|
523126d0a9 | ||
|
|
2750137017 | ||
|
|
2f48db9582 | ||
|
|
6a043f9e29 | ||
|
|
6bd7005957 | ||
|
|
1c072fb5fa | ||
|
|
ce2d663821 | ||
|
|
08fbf028d3 | ||
|
|
bf3dab8782 | ||
|
|
ad2e54a710 | ||
|
|
f686660196 |
+1
-1
@@ -1 +1 @@
|
||||
"""Tests for octopusenergy integration."""
|
||||
"""Tests for integration_blueprint integration."""
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
"""Global fixtures for octopusenergy integration."""
|
||||
"""Global fixtures for integration_blueprint integration."""
|
||||
# Fixtures allow you to replace functions with a Mock object. You can perform
|
||||
# many options via the Mock to reflect a particular behavior from the original
|
||||
# function that you want to see without going through the function's actual logic.
|
||||
@@ -46,7 +46,7 @@ def skip_notifications_fixture():
|
||||
def bypass_get_data_fixture():
|
||||
"""Skip calls to get data from API."""
|
||||
with patch(
|
||||
"custom_components.octopusenergy.IntegrationBlueprintApiClient.async_get_data"
|
||||
"custom_components.integration_blueprint.IntegrationBlueprintApiClient.async_get_data"
|
||||
):
|
||||
yield
|
||||
|
||||
@@ -57,7 +57,7 @@ def bypass_get_data_fixture():
|
||||
def error_get_data_fixture():
|
||||
"""Simulate error when retrieving data from API."""
|
||||
with patch(
|
||||
"custom_components.octopusenergy.IntegrationBlueprintApiClient.async_get_data",
|
||||
"custom_components.integration_blueprint.IntegrationBlueprintApiClient.async_get_data",
|
||||
side_effect=Exception,
|
||||
):
|
||||
yield
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
"""Constants for octopusenergy tests."""
|
||||
from custom_components.octopusenergy.const import CONF_PASSWORD, CONF_USERNAME
|
||||
"""Constants for integration_blueprint tests."""
|
||||
from custom_components.integration_blueprint.const import CONF_PASSWORD, CONF_USERNAME
|
||||
|
||||
# Mock config data to be used across multiple tests
|
||||
MOCK_CONFIG = {CONF_USERNAME: "test_username", CONF_PASSWORD: "test_password"}
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
"""Tests for octopusenergy api."""
|
||||
"""Tests for integration_blueprint api."""
|
||||
import asyncio
|
||||
|
||||
import aiohttp
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
|
||||
from custom_components.octopusenergy.api import IntegrationBlueprintApiClient
|
||||
from custom_components.integration_blueprint.api import IntegrationBlueprintApiClient
|
||||
|
||||
|
||||
async def test_api(hass, aioclient_mock, caplog):
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"""Test octopusenergy config flow."""
|
||||
"""Test integration_blueprint config flow."""
|
||||
from unittest.mock import patch
|
||||
|
||||
from homeassistant import config_entries, data_entry_flow
|
||||
import pytest
|
||||
from pytest_homeassistant_custom_component.common import MockConfigEntry
|
||||
|
||||
from custom_components.octopusenergy.const import (
|
||||
from custom_components.integration_blueprint.const import (
|
||||
BINARY_SENSOR,
|
||||
DOMAIN,
|
||||
PLATFORMS,
|
||||
@@ -23,10 +23,10 @@ from .const import MOCK_CONFIG
|
||||
def bypass_setup_fixture():
|
||||
"""Prevent setup."""
|
||||
with patch(
|
||||
"custom_components.octopusenergy.async_setup",
|
||||
"custom_components.integration_blueprint.async_setup",
|
||||
return_value=True,
|
||||
), patch(
|
||||
"custom_components.octopusenergy.async_setup_entry",
|
||||
"custom_components.integration_blueprint.async_setup_entry",
|
||||
return_value=True,
|
||||
):
|
||||
yield
|
||||
|
||||
+4
-4
@@ -1,15 +1,15 @@
|
||||
"""Test octopusenergy setup process."""
|
||||
"""Test integration_blueprint setup process."""
|
||||
from homeassistant.exceptions import ConfigEntryNotReady
|
||||
import pytest
|
||||
from pytest_homeassistant_custom_component.common import MockConfigEntry
|
||||
|
||||
from custom_components.octopusenergy import (
|
||||
from custom_components.integration_blueprint import (
|
||||
BlueprintDataUpdateCoordinator,
|
||||
async_reload_entry,
|
||||
async_setup_entry,
|
||||
async_unload_entry,
|
||||
)
|
||||
from custom_components.octopusenergy.const import DOMAIN
|
||||
from custom_components.integration_blueprint.const import DOMAIN
|
||||
|
||||
from .const import MOCK_CONFIG
|
||||
|
||||
@@ -26,7 +26,7 @@ async def test_setup_unload_and_reload_entry(hass, bypass_get_data):
|
||||
|
||||
# Set up the entry and assert that the values set during setup are where we expect
|
||||
# them to be. Because we have patched the BlueprintDataUpdateCoordinator.async_get_data
|
||||
# call, no code from custom_components/octopusenergy/api.py actually runs.
|
||||
# call, no code from custom_components/integration_blueprint/api.py actually runs.
|
||||
assert await async_setup_entry(hass, config_entry)
|
||||
assert DOMAIN in hass.data and config_entry.entry_id in hass.data[DOMAIN]
|
||||
assert (
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
"""Test octopusenergy switch."""
|
||||
"""Test integration_blueprint switch."""
|
||||
from unittest.mock import call, patch
|
||||
|
||||
from homeassistant.components.switch import SERVICE_TURN_OFF, SERVICE_TURN_ON
|
||||
from homeassistant.const import ATTR_ENTITY_ID
|
||||
from pytest_homeassistant_custom_component.common import MockConfigEntry
|
||||
|
||||
from custom_components.octopusenergy import async_setup_entry
|
||||
from custom_components.octopusenergy.const import DEFAULT_NAME, DOMAIN, SWITCH
|
||||
from custom_components.integration_blueprint import async_setup_entry
|
||||
from custom_components.integration_blueprint.const import DEFAULT_NAME, DOMAIN, SWITCH
|
||||
|
||||
from .const import MOCK_CONFIG
|
||||
|
||||
@@ -21,7 +21,7 @@ async def test_switch_services(hass):
|
||||
# Functions/objects can be patched directly in test code as well and can be used to test
|
||||
# additional things, like whether a function was called or what arguments it was called with
|
||||
with patch(
|
||||
"custom_components.octopusenergy.IntegrationBlueprintApiClient.async_set_title"
|
||||
"custom_components.integration_blueprint.IntegrationBlueprintApiClient.async_set_title"
|
||||
) as title_func:
|
||||
await hass.services.async_call(
|
||||
SWITCH,
|
||||
|
||||
Reference in New Issue
Block a user