26 lines
535 B
Go
26 lines
535 B
Go
package config
|
|
|
|
import (
|
|
"github.com/stretchr/testify/assert"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestLoadConfig(t *testing.T) {
|
|
path, err := os.Getwd()
|
|
assert.Nil(t, err)
|
|
|
|
path = path + "/../../Config/"
|
|
config := LoadConfig(path)
|
|
|
|
zltx, err := config.GetSystem("直连天下")
|
|
assert.Nil(t, err)
|
|
assert.Equal(t, "root:root@tcp(192.168.6.74:3307)/new_sys?charset=utf8mb4&parseTime=True", zltx.Db)
|
|
|
|
order, err := zltx.GetJob("上游订单")
|
|
assert.Nil(t, err)
|
|
assert.Len(t, order.Tasks, 2)
|
|
|
|
assert.False(t, order.Tasks[0].Timestamp)
|
|
}
|