Test converting PackageRequest to dictionary.
(self)
| 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.""" |
nothing calls this directly
no test coverage detected