Skip to content

Commit

Permalink
fix unit test error
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeMyWorld committed Nov 7, 2020
1 parent a936d9b commit c372c97
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func deleteConfigFile(path string) error {
}

func TestConfigDefault(t *testing.T) {
args := []string{"test", "--mail.smtp", "test.smtp.com"}
args := []string{"test", "--mail.mail-sender-pool-base-url", "localhost"}
// Init config file from command line and config file
c, err := config.NewConfig(args, "")

Expand All @@ -45,7 +45,7 @@ func TestConfigDefault(t *testing.T) {
assert.Equal(t, "3306", c.Database.Port.String(), "default of database port should be 3306")
assert.Equal(t, "", c.Database.Password, "default of database port should be empty")
assert.Equal(t, "pluto", c.Database.DB, "default of database port should be pluto")
assert.Equal(t, "test.smtp.com", c.Mail.SMTP.String(), "default of database port should be empty")
assert.Equal(t, "localhost", *c.Mail.MailSenderPoolBaseUrl, "default of database port should be empty")
}

func TestConfigCustom(t *testing.T) {
Expand All @@ -71,7 +71,7 @@ func TestConfigCustom(t *testing.T) {
"db": "pluto_server"
},
"mail": {
"smtp": "test.smtp.com"
"mail-sender-pool-base-url": "localhost"
}
}`); err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -102,5 +102,5 @@ func TestConfigCustom(t *testing.T) {
assert.Equal(t, "www", c.Database.Password, "database port should be empty")
assert.Equal(t, "pluto_server", c.Database.DB, "database port should be empty")

assert.Equal(t, "test.smtp.com", c.Mail.SMTP.String(), "database port should be empty")
assert.Equal(t, "localhost", *c.Mail.MailSenderPoolBaseUrl, "database port should be empty")
}

0 comments on commit c372c97

Please sign in to comment.