From 5267cb56b543465228f608f5457247c26d59c25b Mon Sep 17 00:00:00 2001 From: David Radcliffe Date: Fri, 8 Sep 2023 08:58:53 -0400 Subject: [PATCH] add test for disabled_components --- tests/test_device.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_device.py b/tests/test_device.py index 62d83c5..eaca957 100644 --- a/tests/test_device.py +++ b/tests/test_device.py @@ -1374,6 +1374,22 @@ def test_attributes(): "level": (100, "%", None), } + @staticmethod + def test_disabled_components(): + """Test the disabled_components property.""" + # Arrange + data = get_json("device_status.json") + status = DeviceStatus(None, DEVICE_ID, data) + # Act/Assert + assert status.disabled_components == [] + # Arrange + data["components"]["main"]["custom.disabledComponents"] = dict( + disabledComponents=dict(value=["SomeDisabledComponent"]) + ) + status = DeviceStatus(None, DEVICE_ID, data) + # Act/Assert + assert status.disabled_components == ["SomeDisabledComponent"] + @staticmethod def test_attributes_default(): """Test the attributes property."""