Skip to content

Commit

Permalink
Fix test pingdom configs
Browse files Browse the repository at this point in the history
  • Loading branch information
namm2 committed Oct 19, 2020
1 parent 0abd270 commit e2f68bf
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ const (

configFilePathPingdom = "../../configs/testConfigs/test-config-pingdom.yaml"
correctTestPingdomConfigMulti = "PingdomMulti"
correctTestPingdomUsername = "user@test.com"
correctTestPingdomAPIURL = "https://api.pingdom.com/v2/"
correctTestPingdomPassword = "SuperSecret"
correctTestPingdomAccountEmail = "multi@test.com"
correctTestPingdomAPIToken = "657a68d9ashdyasjdklkskuasd"
correctTestPingdomAlertContacts = "0544483_0_0-2628365_0_0-2633263_0_0"
correctTestPingdomAlertIntegrations = "91166,10924"
correctTestPingdomAPIKey = "657a68d9ashdyasjdklkskuasd"

configFilePathUptime = "../../configs/testConfigs/test-config-uptime.yaml"
correctTestUptimeConfigName = "Uptime"
Expand All @@ -34,9 +30,8 @@ const (
)

func TestConfigWithCorrectValues(t *testing.T) {
correctConfig := Config{Providers: []Provider{Provider{Name: correctTestPingdomConfigMulti, ApiKey: correctTestPingdomAPIKey, ApiURL: correctTestPingdomAPIURL,
AlertContacts: correctTestPingdomAlertContacts, AlertIntegrations: correctTestPingdomAlertIntegrations,
Username: correctTestPingdomUsername, Password: correctTestPingdomPassword, AccountEmail: correctTestPingdomAccountEmail}},
correctConfig := Config{Providers: []Provider{Provider{Name: correctTestPingdomConfigMulti, ApiToken: correctTestPingdomAPIToken,
AlertContacts: correctTestPingdomAlertContacts, AlertIntegrations: correctTestPingdomAlertIntegrations}},
EnableMonitorDeletion: correctTestEnableMonitorDeletion, ResyncPeriod: 0}

config := ReadConfig(configFilePathPingdom)
Expand Down Expand Up @@ -82,9 +77,8 @@ func TestConfigWithoutEnabledFlag(t *testing.T) {
}

func TestConfigWithPingdomMultiAuthEnabledFlag(t *testing.T) {
correctConfig := Config{Providers: []Provider{Provider{Name: correctTestPingdomConfigMulti, ApiKey: correctTestPingdomAPIKey, ApiURL: correctTestPingdomAPIURL,
AlertContacts: correctTestPingdomAlertContacts, AlertIntegrations: correctTestPingdomAlertIntegrations,
Username: correctTestPingdomUsername, Password: correctTestPingdomPassword, AccountEmail: correctTestPingdomAccountEmail}},
correctConfig := Config{Providers: []Provider{Provider{Name: correctTestPingdomConfigMulti, ApiToken: correctTestPingdomAPIToken,
AlertContacts: correctTestPingdomAlertContacts, AlertIntegrations: correctTestPingdomAlertIntegrations}},
EnableMonitorDeletion: correctTestEnableMonitorDeletion}
config := ReadConfig(configFilePathPingdom)
if !reflect.DeepEqual(config, correctConfig) {
Expand Down

0 comments on commit e2f68bf

Please sign in to comment.