From bf0558f28b5642f00c080deee1948f0813f86ebc Mon Sep 17 00:00:00 2001 From: Joerg Schoppet Date: Sat, 9 Nov 2024 23:13:23 +0100 Subject: [PATCH] Better unittest --- tests/test_base.py | 6 ++++++ tests/test_switch_actuator.py | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_base.py b/tests/test_base.py index bee6f53..7312e11 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -89,3 +89,9 @@ def test_remove_callback(base_instance): base_instance.register_callback(callback) base_instance.remove_callback(callback) assert callback not in base_instance._callbacks + + +def test_update_device(base_instance): + """Test when input-datapoint is provided.""" + + base_instance.update_device("AL_SWITCH_ON_OFF/idp0000", "1") diff --git a/tests/test_switch_actuator.py b/tests/test_switch_actuator.py index 66aa343..6e477e8 100644 --- a/tests/test_switch_actuator.py +++ b/tests/test_switch_actuator.py @@ -139,7 +139,3 @@ def test_callback(): # Test scenario where websocket sends update not relevant to the state. switch_actuator.update_device("AL_INFO_ON_OFF/odp0001", "1") assert switch_actuator.state is False - - # Test scenario where websocket sends update not relevant to the state. - switch_actuator.update_device("AL_SWITCH_ON_OFF/idp0000", "1") - assert switch_actuator.state is False