fix(k1): gate control dialogue on live state
This commit is contained in:
@@ -7,6 +7,7 @@ from k1link.device_plugins.xgrids_k1.protocol.application_bootstrap import (
|
||||
ApplicationControlAuthority,
|
||||
LiveDeviceControlBinding,
|
||||
ShadowApplicationBootstrapOrchestrator,
|
||||
build_canonical_post_start_observation,
|
||||
build_shadow_bootstrap,
|
||||
decode_and_bind_device_info_response,
|
||||
)
|
||||
@@ -148,6 +149,21 @@ def test_bootstrap_headers_switch_from_unbound_to_live_device_identity() -> None
|
||||
)
|
||||
|
||||
|
||||
def test_canonical_post_start_observation_preserves_retained_operations_12_to_14() -> None:
|
||||
plan = build_canonical_post_start_observation(_authority(), _binding())
|
||||
|
||||
assert [request.ordinal for request in plan.requests] == [12, 13, 14]
|
||||
assert [request.message_type for request in plan.requests] == [
|
||||
"ModelingStatusRequest",
|
||||
"DeviceInfoRequest",
|
||||
"ModelingStatusRequest",
|
||||
]
|
||||
assert [request.payload_bytes for request in plan.requests] == [139, 135, 139]
|
||||
assert [request.response_required for request in plan.requests] == [False, True, True]
|
||||
assert all(request.phase == "post-start-observation" for request in plan.requests)
|
||||
assert all(not request.mutates_device for request in plan.requests)
|
||||
|
||||
|
||||
def test_device_info_response_produces_live_binding_without_a_saved_device_profile() -> None:
|
||||
response = decode_and_bind_device_info_response(_device_info_response(), _authority())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user