Skip to content

Commit

Permalink
test: Add test for SLOW_MODE
Browse files Browse the repository at this point in the history
  • Loading branch information
TwiN committed Oct 8, 2022
1 parent 2b913fd commit 2342792
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@ func TestInitialize(t *testing.T) {
_ = os.Setenv(EnvAutoScalingGroupNames, "asg-a,asg-b,asg-c")
_ = os.Setenv(EnvIgnoreDaemonSets, "false")
_ = os.Setenv(EnvDeleteLocalData, "false")
_ = os.Setenv(EnvSlowMode, "true")
defer os.Clearenv()
_ = Initialize()
config := Get()
if len(config.AutoScalingGroupNames) != 3 {
t.Error()
}
if config.IgnoreDaemonSets {
t.Error()
t.Error("IgnoreDaemonSets should be false")
}
if config.DeleteEmptyDirData {
t.Error()
t.Error("DeleteEmptyDirData should be false")
}
if !config.SlowMode {
t.Error("SlowMode should be true")
}
}

Expand All @@ -38,6 +42,9 @@ func TestInitialize_withDefaultNonRequiredValues(t *testing.T) {
if !config.DeleteEmptyDirData {
t.Error("should've defaulted to deleting local data")
}
if config.SlowMode {
t.Error("SlowMode should be false")
}
}

func TestInitialize_withMissingRequiredValues(t *testing.T) {
Expand Down

0 comments on commit 2342792

Please sign in to comment.