test: add tests for handler, email, cmd/server, version and enforce 80% coverage
This commit is contained in:
@@ -95,3 +95,16 @@ to = "you@example.com"
|
||||
t.Fatal("expected an error for an unknown field")
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigPath(t *testing.T) {
|
||||
if got := ConfigPath(); got != "/etc/nuntius/config.toml" {
|
||||
t.Errorf("ConfigPath() = %q, want %q", got, "/etc/nuntius/config.toml")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSMTPConfigAddrFor(t *testing.T) {
|
||||
smtp := SMTPConfig{Host: "smtp.example.com", Port: 587}
|
||||
if got := smtp.AddrFor(); got != "smtp.example.com:587" {
|
||||
t.Errorf("AddrFor() = %q, want %q", got, "smtp.example.com:587")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user