-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
map aws statuses by the resource type as well
- Loading branch information
1 parent
27dd8b5
commit 97e4bdc
Showing
3 changed files
with
143 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package health | ||
|
||
import "testing" | ||
|
||
func TestMapAWSStatus(t *testing.T) { | ||
type args struct { | ||
status string | ||
resourceType string | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
want HealthStatusCode | ||
}{ | ||
{ | ||
name: "ec2", | ||
args: args{status: "shutting-down", resourceType: AWSResourceTypeEC2}, | ||
want: HealthStatusDeleting, | ||
}, | ||
{ | ||
name: "unknown resource", | ||
args: args{status: "shutting-down", resourceType: "blob"}, | ||
want: HealthStatusUnknown, | ||
}, | ||
{ | ||
name: "unknown type", | ||
args: args{status: "wakingup", resourceType: AWSResourceTypeEC2}, | ||
want: HealthStatusUnknown, | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := MapAWSStatus(tt.args.status, tt.args.resourceType); got != string(tt.want) { | ||
t.Errorf("MapAWSStatus() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |