Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
add test for disabled_components
Browse files Browse the repository at this point in the history
  • Loading branch information
dwradcliffe committed Sep 8, 2023
1 parent cef9afa commit 250c65e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"] = {
"disabledComponents": {"value": ["SomeDisabledComponent"]}
}
status = DeviceStatus(None, DEVICE_ID, data)
# Act/Assert
assert status.disabled_components == ["SomeDisabledComponent"]

@staticmethod
def test_attributes_default():
"""Test the attributes property."""
Expand Down

0 comments on commit 250c65e

Please sign in to comment.