Fix #146: Alerting causes panic with some providers

This commit is contained in:
TwinProduction
2021-07-29 18:13:37 -04:00
parent 07b1a2eafb
commit cdbc075439
5 changed files with 22 additions and 9 deletions

View File

@ -6,12 +6,18 @@ import (
)
func TestGetHTTPClient(t *testing.T) {
GetHTTPClient(&Config{
cfg := &Config{
Insecure: false,
IgnoreRedirect: false,
Timeout: 0,
httpClient: nil,
})
}
cfg.ValidateAndSetDefaults()
if GetHTTPClient(cfg) == nil {
t.Error("expected client to not be nil")
}
if GetHTTPClient(nil) == nil {
t.Error("expected client to not be nil")
}
}
func TestPing(t *testing.T) {