mirror of https://github.com/statping/statping
updated tests
parent
3c2df53a7f
commit
cd5ad2a63c
|
@ -208,7 +208,7 @@ func RunMakeDatabaseConfig(t *testing.T, db string) {
|
|||
//Error error `yaml:"-"`
|
||||
//Location string `yaml:"location"`
|
||||
|
||||
config := &core.DbConfig{DbConfig: &types.DbConfig{
|
||||
config := &core.DbConfig{&types.DbConfig{
|
||||
DbConn: db,
|
||||
DbHost: os.Getenv("DB_HOST"),
|
||||
DbUser: os.Getenv("DB_USER"),
|
||||
|
|
|
@ -74,7 +74,7 @@ func LoadUsingEnv() (*types.Config, error) {
|
|||
CoreApp.UseCdn = true
|
||||
}
|
||||
|
||||
dbConfig := &DbConfig{DbConfig: &types.DbConfig{
|
||||
dbConfig := &DbConfig{&types.DbConfig{
|
||||
DbConn: os.Getenv("DB_CONN"),
|
||||
DbHost: os.Getenv("DB_HOST"),
|
||||
DbUser: os.Getenv("DB_USER"),
|
||||
|
@ -89,7 +89,7 @@ func LoadUsingEnv() (*types.Config, error) {
|
|||
Email: "info@localhost.com",
|
||||
}}
|
||||
|
||||
err := DbConnection(dbConfig.DbConn, true, ".")
|
||||
err := DbConnection(dbConfig.DbConn, true, utils.Directory)
|
||||
if err != nil {
|
||||
utils.Log(4, err)
|
||||
return nil, err
|
||||
|
|
|
@ -42,7 +42,7 @@ func TestNewCore(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestDbConfig_Save(t *testing.T) {
|
||||
testConfig = &DbConfig{DbConfig: &types.DbConfig{
|
||||
testConfig = &DbConfig{&types.DbConfig{
|
||||
DbConn: "sqlite",
|
||||
Project: "Tester",
|
||||
Location: dir,
|
||||
|
|
|
@ -131,7 +131,7 @@ func (c *DbConfig) Save() error {
|
|||
utils.Log(4, err)
|
||||
return err
|
||||
}
|
||||
data, err := yaml.Marshal(c)
|
||||
data, err := yaml.Marshal(c.DbConfig)
|
||||
if err != nil {
|
||||
utils.Log(3, err)
|
||||
return err
|
||||
|
|
|
@ -35,7 +35,7 @@ type ErrorResponse struct {
|
|||
|
||||
func LoadSampleData() error {
|
||||
utils.Log(1, "Inserting Sample Data...")
|
||||
s1 := &Service{Service: &types.Service{
|
||||
s1 := &Service{&types.Service{
|
||||
Name: "Google",
|
||||
Domain: "https://google.com",
|
||||
ExpectedStatus: 200,
|
||||
|
@ -44,7 +44,7 @@ func LoadSampleData() error {
|
|||
Method: "GET",
|
||||
Timeout: 10,
|
||||
}}
|
||||
s2 := &Service{Service: &types.Service{
|
||||
s2 := &Service{&types.Service{
|
||||
Name: "Statup Github",
|
||||
Domain: "https://github.com/hunterlong/statup",
|
||||
ExpectedStatus: 200,
|
||||
|
@ -53,7 +53,7 @@ func LoadSampleData() error {
|
|||
Method: "GET",
|
||||
Timeout: 20,
|
||||
}}
|
||||
s3 := &Service{Service: &types.Service{
|
||||
s3 := &Service{&types.Service{
|
||||
Name: "JSON Users Test",
|
||||
Domain: "https://jsonplaceholder.typicode.com/users",
|
||||
ExpectedStatus: 200,
|
||||
|
@ -62,7 +62,7 @@ func LoadSampleData() error {
|
|||
Method: "GET",
|
||||
Timeout: 30,
|
||||
}}
|
||||
s4 := &Service{Service: &types.Service{
|
||||
s4 := &Service{&types.Service{
|
||||
Name: "JSON API Tester",
|
||||
Domain: "https://jsonplaceholder.typicode.com/posts",
|
||||
ExpectedStatus: 201,
|
||||
|
@ -73,7 +73,7 @@ func LoadSampleData() error {
|
|||
PostData: `{ "title": "statup", "body": "bar", "userId": 19999 }`,
|
||||
Timeout: 30,
|
||||
}}
|
||||
s5 := &Service{Service: &types.Service{
|
||||
s5 := &Service{&types.Service{
|
||||
Name: "Google DNS",
|
||||
Domain: "8.8.8.8",
|
||||
Interval: 20,
|
||||
|
|
|
@ -74,7 +74,7 @@ func ProcessSetupHandler(w http.ResponseWriter, r *http.Request) {
|
|||
domain := r.PostForm.Get("domain")
|
||||
email := r.PostForm.Get("email")
|
||||
|
||||
config := &core.DbConfig{DbConfig: &types.DbConfig{
|
||||
config := &core.DbConfig{&types.DbConfig{
|
||||
DbConn: dbConn,
|
||||
DbHost: dbHost,
|
||||
DbUser: dbUser,
|
||||
|
|
Loading…
Reference in New Issue