Test restore() preserves timestamps exactly.
(self, temp_dir)
| 408 | assert registry.get("nonexistent") is None |
| 409 | |
| 410 | def test_restore(self, temp_dir): |
| 411 | """Test restore() preserves timestamps exactly.""" |
| 412 | packs_dir = temp_dir / "packs" |
| 413 | packs_dir.mkdir() |
| 414 | registry = PresetRegistry(packs_dir) |
| 415 | |
| 416 | # Create original entry with a specific timestamp |
| 417 | original_metadata = { |
| 418 | "version": "1.0.0", |
| 419 | "source": "local", |
| 420 | "installed_at": "2025-01-15T10:30:00+00:00", |
| 421 | "enabled": True, |
| 422 | } |
| 423 | registry.restore("test-pack", original_metadata) |
| 424 | |
| 425 | # Verify exact restoration |
| 426 | restored = registry.get("test-pack") |
| 427 | assert restored["installed_at"] == "2025-01-15T10:30:00+00:00" |
| 428 | assert restored["version"] == "1.0.0" |
| 429 | assert restored["enabled"] is True |
| 430 | |
| 431 | def test_restore_rejects_none_metadata(self, temp_dir): |
| 432 | """Test restore() raises ValueError for None metadata.""" |
nothing calls this directly
no test coverage detected