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

Method test_to_dict

ci/util/test_pio_package_messages.py:37–55  ·  view source on GitHub ↗

Test converting PackageRequest to dictionary.

(self)

Source from the content-addressed store, hash-verified

35 assert req.request_id == "req_test_123"
36
37 def test_to_dict(self):
38 """Test converting PackageRequest to dictionary."""
39 req = PackageRequest(
40 project_dir="/path/to/project",
41 environment="esp32c6",
42 timestamp=1234567890.0,
43 caller_pid=12345,
44 caller_cwd="/path/to/cwd",
45 request_id="req_test_123",
46 )
47
48 req_dict = req.to_dict()
49
50 assert req_dict["project_dir"] == "/path/to/project"
51 assert req_dict["environment"] == "esp32c6"
52 assert req_dict["timestamp"] == 1234567890.0
53 assert req_dict["caller_pid"] == 12345
54 assert req_dict["caller_cwd"] == "/path/to/cwd"
55 assert req_dict["request_id"] == "req_test_123"
56
57 def test_from_dict(self):
58 """Test creating PackageRequest from dictionary."""

Callers

nothing calls this directly

Calls 2

to_dictMethod · 0.95
PackageRequestClass · 0.90

Tested by

no test coverage detected