From 1308027c34129c3ba6eea362f3a5a78a2c11417f Mon Sep 17 00:00:00 2001 From: Azareal Date: Sun, 17 Jun 2018 18:12:39 +1000 Subject: [PATCH] This should do it --- general_test.go | 7 +++++-- misc_test.go | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/general_test.go b/general_test.go index 77662121..d53b8dff 100644 --- a/general_test.go +++ b/general_test.go @@ -13,7 +13,6 @@ import ( "time" "./common" - "./config" "./install/install" "./query_gen/lib" "./routes" @@ -53,10 +52,15 @@ func gloinit() (err error) { //nogrouplog = true common.StartTime = time.Now() + err = common.LoadConfig() + if err != nil { + return err + } err = common.ProcessConfig() if err != nil { return err } + common.Themes, err = common.NewThemeList() if err != nil { return err @@ -92,7 +96,6 @@ func gloinit() (err error) { } func init() { - config.Config() err := gloinit() if err != nil { log.Print("Something bad happened") diff --git a/misc_test.go b/misc_test.go index ab83be82..a43aed38 100644 --- a/misc_test.go +++ b/misc_test.go @@ -883,18 +883,18 @@ func TestAuth(t *testing.T) { passwordTest(t, realPassword, hashedPassword2) // TODO: Peek at the prefix to verify this is a bcrypt hash - _, err = common.Auth.Authenticate("None", "password") + _, err, _ = common.Auth.Authenticate("None", "password") errmsg := "Username None shouldn't exist" if err != nil { errmsg += "\n" + err.Error() } expect(t, err == common.ErrNoUserByName, errmsg) - uid, err := common.Auth.Authenticate("Admin", "password") + uid, err, _ := common.Auth.Authenticate("Admin", "password") expectNilErr(t, err) expect(t, uid == 1, fmt.Sprintf("Default admin uid should be 1 not %d", uid)) - _, err = common.Auth.Authenticate("Sam", "ReallyBadPassword") + _, err, _ = common.Auth.Authenticate("Sam", "ReallyBadPassword") errmsg = "Username Sam shouldn't exist" if err != nil { errmsg += "\n" + err.Error()