Files
zerto-ai-rewind/tests/test_checkpoints.py
T
claude 38ba9c1b50 feat(poc): rewind MCP, skill, and recover-ladder docs
Initial PoC: find_protection, tagged checkpoints, FLR, mutating catalog.
Lab 10.9 status enums (0=Initializing, 1=MeetingSLA). Credentials stay in gitignored config.json.
2026-09-21 12:09:11 -04:00

25 lines
813 B
Python

from datetime import UTC, datetime
from zerto_rewind_mcp.checkpoints import checkpoint_id, checkpoint_tag, make_tag
def test_tag_format():
when = datetime(2026, 9, 21, 15, 4, 5, tzinfo=UTC)
tag = make_tag("codex", "chg-99", when)
assert tag == "ai:codex:chg-99:20260921T150405Z"
def test_tag_strips_junk():
tag = make_tag("agent one", "path/with spaces", datetime(2026, 1, 1, tzinfo=UTC))
assert " " not in tag
assert tag.startswith("ai:agent-one:path-with-spaces:")
def test_checkpoint_row_keys():
row = {"CheckpointId": "cp-1", "Tag": "ai:x:y:z", "Timestamp": 1}
assert checkpoint_id(row) == "cp-1"
assert checkpoint_tag(row) == "ai:x:y:z"
row2 = {"checkpointId": "cp-2", "tag": "t"}
assert checkpoint_id(row2) == "cp-2"
assert checkpoint_tag(row2) == "t"