1
0
Fork 0
forked from forgejo/forgejo

Remove unnecessary code (#24610)

As title, remove unnecessary code.
This commit is contained in:
Lunny Xiao 2023-05-10 12:57:06 +08:00 committed by GitHub
parent 29637b03b2
commit c355728a6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 20 deletions

View file

@ -10,7 +10,6 @@ import (
)
func Test_loadMailerFrom(t *testing.T) {
iniFile := NewEmptyConfigProvider()
kases := map[string]*Mailer{
"smtp.mydomain.com": {
SMTPAddr: "smtp.mydomain.com",
@ -27,13 +26,13 @@ func Test_loadMailerFrom(t *testing.T) {
}
for host, kase := range kases {
t.Run(host, func(t *testing.T) {
iniFile.DeleteSection("mailer")
sec := iniFile.Section("mailer")
cfg, _ := NewConfigProviderFromData("")
sec := cfg.Section("mailer")
sec.NewKey("ENABLED", "true")
sec.NewKey("HOST", host)
// Check mailer setting
loadMailerFrom(iniFile)
loadMailerFrom(cfg)
assert.EqualValues(t, kase.SMTPAddr, MailService.SMTPAddr)
assert.EqualValues(t, kase.SMTPPort, MailService.SMTPPort)