fix compilation errors for go tests

This commit is contained in:
root
2021-05-16 08:35:31 +00:00
parent 588980e7bc
commit e019c99f60
2 changed files with 2 additions and 6 deletions

View File

@@ -85,7 +85,7 @@ func helpConfigurationDump(token string) ([]byte, error) {
func init() {
fmt.Printf("**INIT*TEST*CODE***\n")
testDBFile := storage.CreateTestDB()
db, myRootToken, err := setupDB(&testDBFile)
db, myRootToken, err := setupDB(&testDBFile, nil, "DEMO")
if err != nil {
//log.Panic("error %s", err.Error())
fmt.Printf("error %s", err.Error())
@@ -94,9 +94,8 @@ func init() {
db.store.InitUserApps()
var cfg2 Config
cfile := "../databunker.yaml"
readFile(&cfg2, &cfile)
readConfFile(&cfg2, &cfile)
var cfg Config
cfg.Sms.TwilioToken = "ttoken"
cfg.SelfService.AppRecordChange = []string{"testapp", "super"}
cfg.Generic.CreateUserWithoutAccessToken = true
cfg.Policy.MaxAuditRetentionPeriod = "1m"

View File

@@ -107,9 +107,6 @@ func TestSMS(t *testing.T) {
client := server.Client()
domain := server.URL
var cfg Config
cfg.Sms.TwilioToken = "ttoken"
cfg.Sms.TwilioAccount = "taccount"
cfg.Sms.TwilioFrom = "from1234"
sendCodeByPhoneDo(domain, client, 1234, "4444", cfg)
}