player object

This commit is contained in:
2026-06-25 14:46:30 -04:00
parent f105d5b7c2
commit 55d1a66cfb
4 changed files with 54 additions and 33 deletions

View File

@@ -1,6 +1,6 @@
import pytest
from untitled import content, migration, model, persistence, rules
from untitled import content, model, persistence, rules
def test_save_load_roundtrip(tmp_path):
@@ -28,23 +28,23 @@ def test_save_load_roundtrip(tmp_path):
assert loaded.version == content.SAVE_VERSION
def test_migration():
v1 = {
"version": 1,
"cat": {
"name": "Fry",
"traits": {
"size": "tiny",
"color": "tuxedo",
"eyes": "blue",
"personality": "judges you silently",
},
},
}
result = migration.migrate(v1)
assert result["version"] == content.SAVE_VERSION
assert result["cat"]["fullness"] == 100
assert "last_updated" in result["cat"]
# def test_migration():
# v1 = {
# "version": 1,
# "cat": {
# "name": "Fry",
# "traits": {
# "size": "tiny",
# "color": "tuxedo",
# "eyes": "blue",
# "personality": "judges you silently",
# },
# },
# }
# result = migration.migrate(v1)
# assert result["version"] == content.SAVE_VERSION
# assert result["cat"]["fullness"] == 100
# assert "last_updated" in result["cat"]
def test_decay_and_replenish():