tests: point model tests at db/ and align palette assertions

Made-with: Cursor
This commit is contained in:
2026-03-21 20:17:33 +13:00
parent aaca5435e9
commit 7b724e9ce1
3 changed files with 39 additions and 28 deletions

View File

@@ -6,11 +6,13 @@ def test_model():
# Create a test model class
class TestModel(Model):
pass
# Clean up any existing test file
if os.path.exists("TestModel.json"):
os.remove("TestModel.json")
# Clean up any existing test file (model uses db/<classname>.json)
db_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "db")
testmodel_file = os.path.join(db_dir, "testmodel.json")
if os.path.exists(testmodel_file):
os.remove(testmodel_file)
model = TestModel()
print("Testing get_next_id with empty model")
@@ -43,9 +45,9 @@ def test_model():
assert hasattr(model2, 'set_defaults')
# Clean up
if os.path.exists("TestModel.json"):
os.remove("TestModel.json")
if os.path.exists(testmodel_file):
os.remove(testmodel_file)
print("\nAll model base class tests passed!")