summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-05-09 22:23:28 +0200
committerxengineering <me@xengineering.eu>2024-05-09 22:23:28 +0200
commit0142af99aba36241c276a56a088e7aac10c62f86 (patch)
treef1cfed7d60cd55feb15ae654ba7862198669f1cf
parentf7fca11c47224ff28b10a7f41fb76ce0404a0236 (diff)
downloadceres-0142af99aba36241c276a56a088e7aac10c62f86.tar
ceres-0142af99aba36241c276a56a088e7aac10c62f86.tar.zst
ceres-0142af99aba36241c276a56a088e7aac10c62f86.zip
model: Fix unit tests
-rw-r--r--model/recipe_test.go5
-rw-r--r--model/recipes_test.go5
2 files changed, 2 insertions, 8 deletions
diff --git a/model/recipe_test.go b/model/recipe_test.go
index 37b43e0..1119d20 100644
--- a/model/recipe_test.go
+++ b/model/recipe_test.go
@@ -19,13 +19,10 @@ func TestRecipeCrud(t *testing.T) {
defer os.RemoveAll(storagePath)
storage := NewStorage(storagePath)
- if !storage.Exists() {
- storage.Create()
- }
ConnectDatabase(filepath.Join(storage.Path, "ceres.sqlite3"))
defer DisconnectDatabase()
- MigrateDatabase()
+ MigrateDatabase("dummy_version")
Transaction(func(tx *sql.Tx) error {
var original, readback, update, updated, deleted Recipe
diff --git a/model/recipes_test.go b/model/recipes_test.go
index d17ed92..159422f 100644
--- a/model/recipes_test.go
+++ b/model/recipes_test.go
@@ -17,13 +17,10 @@ func TestRecipesRead(t *testing.T) {
defer os.RemoveAll(storagePath)
storage := NewStorage(storagePath)
- if !storage.Exists() {
- storage.Create()
- }
ConnectDatabase(filepath.Join(storage.Path, "ceres.sqlite3"))
defer DisconnectDatabase()
- MigrateDatabase()
+ MigrateDatabase("dummy_version")
InjectTestRecipes()