MCPcopy Create free account
hub / github.com/FastLED/FastLED / test_roundtrip

Method test_roundtrip

ci/util/test_pio_package_messages.py:185–205  ·  view source on GitHub ↗

Test round-trip conversion: object -> dict -> object.

(self)

Source from the content-addressed store, hash-verified

183 assert status.current_operation == "Downloading toolchain"
184
185 def test_roundtrip(self):
186 """Test round-trip conversion: object -> dict -> object."""
187 original = DaemonStatus(
188 state=DaemonState.FAILED,
189 message="Installation failed",
190 updated_at=1234567890.0,
191 installation_in_progress=False,
192 daemon_pid=9999,
193 current_operation=None, # Test None value
194 )
195
196 # Convert to dict and back
197 data = original.to_dict()
198 restored = DaemonStatus.from_dict(data)
199
200 assert restored.state == original.state
201 assert restored.message == original.message
202 assert restored.updated_at == original.updated_at
203 assert restored.installation_in_progress == original.installation_in_progress
204 assert restored.daemon_pid == original.daemon_pid
205 assert restored.current_operation == original.current_operation
206
207 def test_is_stale(self):
208 """Test stale detection."""

Callers

nothing calls this directly

Calls 3

to_dictMethod · 0.95
DaemonStatusClass · 0.90
from_dictMethod · 0.45

Tested by

no test coverage detected