From 2eca9ff6423a54d615af64e05a1a1ba629108d39 Mon Sep 17 00:00:00 2001 From: Toasterkitten Date: Wed, 24 Jun 2026 19:45:44 -0400 Subject: [PATCH] migration test --- tests/test_persistence.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/test_persistence.py b/tests/test_persistence.py index 57fa8a5..9d0a83d 100644 --- a/tests/test_persistence.py +++ b/tests/test_persistence.py @@ -26,6 +26,25 @@ def test_save_load_roundtrip(tmp_path): assert loaded.version == content.SAVE_VERSION +def test_migration(tmp_path): + cat = model.Save( + version=1, + cat=model.Cat( + "Fry", + { + "size": "tiny", + "color": "tuxedo", + "eyes": "blue", + "personality": "judges you silently", + }, + ), + ) + persistence.save(cat, tmp_path) + loaded = persistence.load("Fry", tmp_path) + assert loaded.cat.fullness + assert loaded.cat.last_updated + + def test_list_saves(tmp_path): open(tmp_path / "test.kitten", "w").close() open(tmp_path / "test2.kitten", "w").close()