MCPcopy
hub / github.com/github/spec-kit / test_restore

Method test_restore

tests/test_presets.py:410–429  ·  view source on GitHub ↗

Test restore() preserves timestamps exactly.

(self, temp_dir)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 3

restoreMethod · 0.95
getMethod · 0.95
PresetRegistryClass · 0.90

Tested by

no test coverage detected