pull/78/head v0.68
hunterlong 2018-09-26 22:31:39 -07:00
parent 2a80d827a6
commit 62f4d0a8ae
4 changed files with 7 additions and 8 deletions

View File

@ -234,7 +234,7 @@ func RunSaveConfig(t *testing.T, db string) {
} else if db == "mssql" {
port = 1433
}
core.Configs = &core.DbConfig{DbConfig: &types.DbConfig{
core.Configs = &core.DbConfig{
DbConn: db,
DbHost: os.Getenv("DB_HOST"),
DbUser: os.Getenv("DB_USER"),
@ -249,7 +249,7 @@ func RunSaveConfig(t *testing.T, db string) {
Email: "",
Error: nil,
Location: dir,
}}
}
core.Configs, err = core.Configs.Save()
assert.Nil(t, err)
}

View File

@ -17,7 +17,6 @@ package core
import (
"github.com/hunterlong/statup/source"
"github.com/hunterlong/statup/types"
"github.com/hunterlong/statup/utils"
"github.com/stretchr/testify/assert"
"testing"
@ -43,11 +42,11 @@ func TestNewCore(t *testing.T) {
func TestDbConfig_Save(t *testing.T) {
var err error
Configs = &DbConfig{&types.DbConfig{
Configs = &DbConfig{
DbConn: "sqlite",
Project: "Tester",
Location: dir,
}}
}
Configs, err = Configs.Save()
assert.Nil(t, err)
assert.Equal(t, "sqlite", Configs.DbConn)

View File

@ -232,7 +232,7 @@ func TestRunAllQueueAndStop(t *testing.T) {
assert.Equal(t, 16, len(example.Queue))
go Queue(example)
assert.Equal(t, 16, len(example.Queue))
time.Sleep(6 * time.Second)
time.Sleep(10 * time.Second)
assert.Equal(t, 6, len(example.Queue))
example.close()
assert.False(t, example.IsRunning())

View File

@ -46,10 +46,10 @@ func init() {
func loadDatabase() {
core.NewCore()
core.LoadConfig(dir)
core.Configs = &core.DbConfig{DbConfig: &types.DbConfig{
core.Configs = &core.DbConfig{
DbConn: "sqlite",
Location: dir,
}}
}
core.Configs.Connect(false, utils.Directory)
core.CoreApp.DbConnection = "sqlite"
core.CoreApp.Version = "DEV"