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

Method test_roundtrip

ci/util/test_pio_package_messages.py:77–95  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

75 assert req.request_id == "req_test_123"
76
77 def test_roundtrip(self):
78 """Test round-trip conversion: object -> dict -> object."""
79 original = PackageRequest(
80 project_dir="/path/to/project",
81 environment=None, # Test None value
82 timestamp=1234567890.0,
83 caller_pid=12345,
84 caller_cwd="/path/to/cwd",
85 )
86
87 # Convert to dict and back
88 data = original.to_dict()
89 restored = PackageRequest.from_dict(data)
90
91 assert restored.project_dir == original.project_dir
92 assert restored.environment == original.environment
93 assert restored.timestamp == original.timestamp
94 assert restored.caller_pid == original.caller_pid
95 assert restored.caller_cwd == original.caller_cwd
96
97 def test_auto_generated_request_id(self):
98 """Test that request_id is auto-generated if not provided."""

Callers

nothing calls this directly

Calls 3

to_dictMethod · 0.95
PackageRequestClass · 0.90
from_dictMethod · 0.45

Tested by

no test coverage detected