tests: point model tests at db/ and align palette assertions
Made-with: Cursor
This commit is contained in:
@@ -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!")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user