Files
localthings/tests/test_capability.py
T
Marc Billow cc2c1e5a1f refactor: move samsung_appliance/ into custom_components/localthings/ocf/
Makes the integration fully self-contained for HACS distribution.
Users installing via HACS get everything in one directory; no external
samsung_appliance package needed.

All component imports updated to relative (.ocf.*); all test imports
updated to custom_components.localthings.ocf.*. ocf_root_ca.pem moves
with the package and resolves correctly via Path(__file__).parent.
2026-06-30 16:34:20 -05:00

20 lines
655 B
Python

from custom_components.localthings.ocf.registry.capability import Capability
from custom_components.localthings.ocf.registry.entities import BinarySensorDesc
def test_capability_defaults():
c = Capability(href='/kidslock/vs/0',
entities=(BinarySensorDesc(key='child_lock', field='x.com.samsung.da.kidsLock'),))
assert c.poll_tier == 'warm'
assert c.active_when is None
assert len(c.entities) == 1
def test_capability_is_frozen():
c = Capability(href='/kidslock/vs/0', entities=())
try:
c.href = '/other/vs/0'
except Exception:
return
raise AssertionError("expected frozen dataclass")