test: remove duplicate test case

main
sundowndev 2021-03-19 19:24:04 +01:00
parent 77a8227a4d
commit edb5de32c0
No known key found for this signature in database
GPG Key ID: 8916203E540C65A4
1 changed files with 0 additions and 55 deletions

View File

@ -1207,58 +1207,3 @@ func TestAnalysis_UnmarshalJSON(t *testing.T) {
assert.Len(t, got.alerts, 1)
assert.Equal(t, got.alerts["aws_iam_access_key"][0].Message(), "This is an alert")
}
func TestAnalysis_Sort(t *testing.T) {
cases := []struct {
name string
iac []resource.Resource
cloud []resource.Resource
expected Analysis
}{
{
name: "unmanaged resources are sorted",
},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
filter := &mocks.Filter{}
filter.On("IsResourceIgnored", mock.Anything).Return(false)
filter.On("IsFieldIgnored", mock.Anything, mock.Anything).Return(false)
al := alerter.NewAlerter()
analyzer := NewAnalyzer(al)
result, err := analyzer.Analyze(c.cloud, c.iac, filter)
if err != nil {
t.Error(err)
return
}
for i, expected := range c.expected.Unmanaged() {
actual := result.Unmanaged()[i]
unmanagedChanges, err := diff.Diff(actual, expected)
if err != nil {
t.Fatalf("Unable to compare %+v", err)
}
if len(unmanagedChanges) > 0 {
for _, change := range unmanagedChanges {
t.Errorf("%+v", change)
}
}
}
deletedChanges, err := diff.Diff(result.Deleted(), c.expected.Deleted())
if err != nil {
t.Fatalf("Unable to compare %+v", err)
}
if len(deletedChanges) > 0 {
for _, change := range deletedChanges {
t.Errorf("%+v", change)
}
}
})
}
}