1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-09 03:57:19 +00:00

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
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)