piphi-runtime-testkit-python 0.3.2__tar.gz → 0.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/PKG-INFO +1 -1
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/pyproject.toml +1 -1
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/src/piphi_runtime_testkit_python/behavior_contract.py +8 -2
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_strict_contracts.py +6 -6
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/LICENSE +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/README.md +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/src/piphi_runtime_testkit_python/__init__.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/src/piphi_runtime_testkit_python/assertions.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/src/piphi_runtime_testkit_python/builders.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/src/piphi_runtime_testkit_python/camera.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/src/piphi_runtime_testkit_python/cross_contract.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/src/piphi_runtime_testkit_python/harness.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/src/piphi_runtime_testkit_python/mock_core.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/src/piphi_runtime_testkit_python/pytest_plugin.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/src/piphi_runtime_testkit_python/waits.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/__init__.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_assertions.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_behavior_contract.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_builders.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_camera.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_command_contract.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_fastapi_runtime_example.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_mock_core.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_mock_core_sequences.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_pytest_plugin.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_runtime_config_contract.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_runtime_flow.py +0 -0
- {piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_runtime_harness.py +0 -0
|
@@ -86,8 +86,14 @@ def _runtime_state_samples(
|
|
|
86
86
|
for raw_sample in raw_samples:
|
|
87
87
|
payload = _as_mapping(raw_sample)
|
|
88
88
|
entries = payload.get("entries")
|
|
89
|
-
if isinstance(entries,
|
|
90
|
-
|
|
89
|
+
if isinstance(entries, Mapping):
|
|
90
|
+
entry_values = entries.values()
|
|
91
|
+
elif isinstance(entries, (list, tuple)):
|
|
92
|
+
entry_values = entries
|
|
93
|
+
else:
|
|
94
|
+
entry_values = None
|
|
95
|
+
if entry_values is not None:
|
|
96
|
+
for entry in entry_values:
|
|
91
97
|
mapped_entry = _as_mapping(entry)
|
|
92
98
|
append_state(mapped_entry.get("latest_state", mapped_entry))
|
|
93
99
|
else:
|
|
@@ -140,13 +140,13 @@ def test_cross_contract_requires_every_behavior_action_and_trigger_to_be_exercis
|
|
|
140
140
|
)
|
|
141
141
|
|
|
142
142
|
|
|
143
|
-
def
|
|
143
|
+
def test_cross_contract_validates_shelly_condition_from_keyed_runtime_state_entries() -> None:
|
|
144
144
|
capabilities = {"on": {"kind": "sensor", "unit": "bool"}}
|
|
145
145
|
entities = {
|
|
146
146
|
"entities": [{
|
|
147
147
|
"id": "shelly-aabbccddeeff:switch:0",
|
|
148
148
|
"name": "Switch 0",
|
|
149
|
-
"config_id": "shelly-
|
|
149
|
+
"config_id": "shelly-test",
|
|
150
150
|
"device_id": "shelly-aabbccddeeff",
|
|
151
151
|
"capabilities": ["on"],
|
|
152
152
|
"available_commands": [],
|
|
@@ -164,8 +164,8 @@ def test_cross_contract_validates_shelly_condition_from_runtime_state() -> None:
|
|
|
164
164
|
}],
|
|
165
165
|
}]}
|
|
166
166
|
state_response = {
|
|
167
|
-
"entries":
|
|
168
|
-
"config_id": "shelly-
|
|
167
|
+
"entries": {"shelly-test": {
|
|
168
|
+
"config_id": "shelly-test",
|
|
169
169
|
"device_id": "shelly-aabbccddeeff",
|
|
170
170
|
"latest_state": {
|
|
171
171
|
"connected": True,
|
|
@@ -173,10 +173,10 @@ def test_cross_contract_validates_shelly_condition_from_runtime_state() -> None:
|
|
|
173
173
|
"key": "switch:0",
|
|
174
174
|
"type": "switch",
|
|
175
175
|
"channel": 0,
|
|
176
|
-
"on":
|
|
176
|
+
"on": False,
|
|
177
177
|
}],
|
|
178
178
|
},
|
|
179
|
-
}
|
|
179
|
+
}},
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
assert_cross_contract(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_assertions.py
RENAMED
|
File without changes
|
|
File without changes
|
{piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_builders.py
RENAMED
|
File without changes
|
{piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_camera.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_mock_core.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{piphi_runtime_testkit_python-0.3.2 → piphi_runtime_testkit_python-0.3.3}/tests/test_runtime_flow.py
RENAMED
|
File without changes
|
|
File without changes
|