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

Method test_from_dict

ci/util/test_pio_package_messages.py:57–75  ·  view source on GitHub ↗

Test creating PackageRequest from dictionary.

(self)

Source from the content-addressed store, hash-verified

55 assert req_dict["request_id"] == "req_test_123"
56
57 def test_from_dict(self):
58 """Test creating PackageRequest from dictionary."""
59 data = {
60 "project_dir": "/path/to/project",
61 "environment": "esp32c6",
62 "timestamp": 1234567890.0,
63 "caller_pid": 12345,
64 "caller_cwd": "/path/to/cwd",
65 "request_id": "req_test_123",
66 }
67
68 req = PackageRequest.from_dict(data)
69
70 assert req.project_dir == "/path/to/project"
71 assert req.environment == "esp32c6"
72 assert req.timestamp == 1234567890.0
73 assert req.caller_pid == 12345
74 assert req.caller_cwd == "/path/to/cwd"
75 assert req.request_id == "req_test_123"
76
77 def test_roundtrip(self):
78 """Test round-trip conversion: object -> dict -> object."""

Callers

nothing calls this directly

Calls 1

from_dictMethod · 0.45

Tested by

no test coverage detected