mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 10:47:10 +00:00
Adjust invalid test values in snmp (#86006)
This commit is contained in:
parent
c1589d3c89
commit
8165f487c7
@ -15,7 +15,7 @@ from homeassistant.setup import async_setup_component
|
|||||||
def hlapi_mock():
|
def hlapi_mock():
|
||||||
"""Mock out 3rd party API."""
|
"""Mock out 3rd party API."""
|
||||||
mock_data = MagicMock()
|
mock_data = MagicMock()
|
||||||
mock_data.prettyPrint = Mock(return_value="hello")
|
mock_data.prettyPrint = Mock(return_value="13.5")
|
||||||
future = asyncio.get_event_loop().create_future()
|
future = asyncio.get_event_loop().create_future()
|
||||||
future.set_result((None, None, None, [[mock_data]]))
|
future.set_result((None, None, None, [[mock_data]]))
|
||||||
with patch(
|
with patch(
|
||||||
@ -40,7 +40,7 @@ async def test_basic_config(hass: HomeAssistant) -> None:
|
|||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
state = hass.states.get("sensor.snmp")
|
state = hass.states.get("sensor.snmp")
|
||||||
assert state.state == "hello"
|
assert state.state == "13.5"
|
||||||
assert state.attributes == {"friendly_name": "SNMP"}
|
assert state.attributes == {"friendly_name": "SNMP"}
|
||||||
|
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ async def test_entity_config(hass: HomeAssistant) -> None:
|
|||||||
assert entity_registry.async_get("sensor.snmp_sensor").unique_id == "very_unique"
|
assert entity_registry.async_get("sensor.snmp_sensor").unique_id == "very_unique"
|
||||||
|
|
||||||
state = hass.states.get("sensor.snmp_sensor")
|
state = hass.states.get("sensor.snmp_sensor")
|
||||||
assert state.state == "hello"
|
assert state.state == "13.5"
|
||||||
assert state.attributes == {
|
assert state.attributes == {
|
||||||
"device_class": "temperature",
|
"device_class": "temperature",
|
||||||
"entity_picture": "blabla.png",
|
"entity_picture": "blabla.png",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user