Files
localthings/tests/test_end_to_end_v2.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

29 lines
986 B
Python

import pytest
from tests.conftest import _load_device
from custom_components.localthings.ocf.registry.by_type import for_device, _type_key
from custom_components.localthings.ocf.registry.discovery import discover
from custom_components.localthings.ocf.registry.adapter import flatten, is_active
@pytest.mark.parametrize('name,expected_type_key', [
('dishwasher', 'dishwasher'),
('refrigerator', 'refrigerator'),
])
def test_full_pipeline_v2(name, expected_type_key):
resources = _load_device(name)
otn = resources.get('/otninformation/vs/0', {})
one_ui = otn.get('swVersionInfo', {}).get('oneUiVersion', '')
assert _type_key(one_ui) == expected_type_key
reg = for_device(one_ui)
assert reg is not None
bound = discover(resources, reg.capabilities, reg.pattern_capabilities)
assert bound
state = flatten(bound, resources)
assert state
# is_active returns bool; just verify it runs without error
is_active(bound, resources)