Test round-trip conversion: object -> dict -> object.
(self)
| 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.""" |
nothing calls this directly
no test coverage detected