Adjust invalid test values in snmp (#86006)

This commit is contained in:
epenet 2023-01-16 14:00:37 +01:00 committed by GitHub
parent c1589d3c89
commit 8165f487c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,7 @@ from homeassistant.setup import async_setup_component
def hlapi_mock():
"""Mock out 3rd party API."""
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.set_result((None, None, None, [[mock_data]]))
with patch(
@ -40,7 +40,7 @@ async def test_basic_config(hass: HomeAssistant) -> None:
await hass.async_block_till_done()
state = hass.states.get("sensor.snmp")
assert state.state == "hello"
assert state.state == "13.5"
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"
state = hass.states.get("sensor.snmp_sensor")
assert state.state == "hello"
assert state.state == "13.5"
assert state.attributes == {
"device_class": "temperature",
"entity_picture": "blabla.png",