mirror of
https://github.com/home-assistant/core.git
synced 2026-07-05 13:45:32 +01:00
95f3bd7c09
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
20 lines
612 B
Python
20 lines
612 B
Python
"""Test HomematicIP Cloud helper functions."""
|
|
|
|
import json
|
|
|
|
from homeassistant.components.homematicip_cloud.helpers import is_error_response
|
|
|
|
|
|
async def test_is_error_response() -> None:
|
|
"""Test, if an response is a normal result or an error."""
|
|
assert not is_error_response("True")
|
|
assert not is_error_response(True)
|
|
assert not is_error_response("")
|
|
assert is_error_response(
|
|
json.loads(
|
|
'{"errorCode": "INVALID_NUMBER_PARAMETER_VALUE",'
|
|
' "minValue": 0.0, "maxValue": 1.01}'
|
|
)
|
|
)
|
|
assert not is_error_response(json.loads('{"errorCode": ""}'))
|