Black
This commit is contained in:
1 parent
da05dfe708
commit
4de97abc3a
2676 files changed
+163166
-140084
No files matched your search
@@ -4,19 +4,18 @@ from unittest.mock import MagicMock
|
||||
import pytest
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate import (
|
||||
SET_TEMPERATURE_SCHEMA, ClimateDevice)
|
||||
from homeassistant.components.climate import SET_TEMPERATURE_SCHEMA, ClimateDevice
|
||||
from tests.common import async_mock_service
|
||||
|
||||
|
||||
async def test_set_temp_schema_no_req(hass, caplog):
|
||||
"""Test the set temperature schema with missing required data."""
|
||||
domain = 'climate'
|
||||
service = 'test_set_temperature'
|
||||
domain = "climate"
|
||||
service = "test_set_temperature"
|
||||
schema = SET_TEMPERATURE_SCHEMA
|
||||
calls = async_mock_service(hass, domain, service, schema)
|
||||
|
||||
data = {'hvac_mode': 'off', 'entity_id': ['climate.test_id']}
|
||||
data = {"hvac_mode": "off", "entity_id": ["climate.test_id"]}
|
||||
with pytest.raises(vol.Invalid):
|
||||
await hass.services.async_call(domain, service, data)
|
||||
await hass.async_block_till_done()
|
||||
@@ -26,14 +25,12 @@ async def test_set_temp_schema_no_req(hass, caplog):
|
||||
|
||||
async def test_set_temp_schema(hass, caplog):
|
||||
"""Test the set temperature schema with ok required data."""
|
||||
domain = 'climate'
|
||||
service = 'test_set_temperature'
|
||||
domain = "climate"
|
||||
service = "test_set_temperature"
|
||||
schema = SET_TEMPERATURE_SCHEMA
|
||||
calls = async_mock_service(hass, domain, service, schema)
|
||||
|
||||
data = {
|
||||
'temperature': 20.0, 'hvac_mode': 'heat',
|
||||
'entity_id': ['climate.test_id']}
|
||||
data = {"temperature": 20.0, "hvac_mode": "heat", "entity_id": ["climate.test_id"]}
|
||||
await hass.services.async_call(domain, service, data)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
|
||||
Reference in new issue
Block a user