Adapt testing

This commit is contained in:
Jan Eitzinger
2022-02-11 11:04:26 +01:00
parent f2ae0daec2
commit abcfc48802
4 changed files with 39 additions and 21 deletions

25
test/db.go Normal file
View File

@@ -0,0 +1,25 @@
package test
import (
"fmt"
"os"
"github.com/jmoiron/sqlx"
)
func InitDB() *sqlx.DB {
bp := "./"
ebp := os.Getenv("BASEPATH")
if ebp != "" {
bp = ebp + "test/"
}
db, err := sqlx.Open("sqlite3", bp+"test.db")
if err != nil {
fmt.Println(err)
}
return db
}

BIN
test/test.db Normal file

Binary file not shown.