You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
End-to-end tests through the whole stack, in test_e2e_device.py: a real nCyncServer on an ephemeral port, real platform setup so entities are
genuinely created, and a real Cync device connected over TLS - the library's
own cync_lan.testing.VirtualCyncDevice, shipped in 0.10.0 so both
repositories drive the same simulator instead of two copies that drift.
Every other test here mocks nCyncServer, which is right for what they check
but leaves the seam this integration actually is - Home Assistant's entity
model on one side, a device on a socket on the other - with nothing covering
it. In between sit the config parse, entity construction, the bridge, send_command's framing and the broadcast pool.
light.turn_on now has a test that reads what arrives on the socket and
asserts the 0x73 control packet carries 11 02 01 00 00, the payload set_power builds. Verified by mutation: make set_power ignore its state
argument and the turn-on test fails while turn-off still passes, which is the
discrimination that makes it worth having.
One thing worth knowing if you write more of these: setup goes through hass.config_entries.async_setup() rather than calling async_setup_entry()
directly, as the rest of the suite does. A direct call leaves the entry in NOT_LOADED, async_forward_entry_setups refuses to run from that state, and
no entities are ever created - so a test written the usual way silently checks
nothing.
What this does not do is tell you a bulb turns on. The simulator is built
from the library's own understanding of the protocol, so a pass means the stack
agrees with itself. docs/hardware_verification.md is still the only record of
what hardware has confirmed.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
End-to-end tests through the whole stack, in
test_e2e_device.py: a realnCyncServeron an ephemeral port, real platform setup so entities aregenuinely created, and a real Cync device connected over TLS - the library's
own
cync_lan.testing.VirtualCyncDevice, shipped in 0.10.0 so bothrepositories drive the same simulator instead of two copies that drift.
Every other test here mocks
nCyncServer, which is right for what they checkbut leaves the seam this integration actually is - Home Assistant's entity
model on one side, a device on a socket on the other - with nothing covering
it. In between sit the config parse, entity construction, the bridge,
send_command's framing and the broadcast pool.light.turn_onnow has a test that reads what arrives on the socket andasserts the
0x73control packet carries11 02 01 00 00, the payloadset_powerbuilds. Verified by mutation: makeset_powerignore its stateargument and the turn-on test fails while turn-off still passes, which is the
discrimination that makes it worth having.
One thing worth knowing if you write more of these: setup goes through
hass.config_entries.async_setup()rather than callingasync_setup_entry()directly, as the rest of the suite does. A direct call leaves the entry in
NOT_LOADED,async_forward_entry_setupsrefuses to run from that state, andno entities are ever created - so a test written the usual way silently checks
nothing.
What this does not do is tell you a bulb turns on. The simulator is built
from the library's own understanding of the protocol, so a pass means the stack
agrees with itself.
docs/hardware_verification.mdis still the only record ofwhat hardware has confirmed.
This discussion was created from the release cync_lan (Home Assistant custom_component) v2.10.0.
All reactions