Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
austingebauer committed Dec 17, 2021
1 parent fa7335d commit 04bab41
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions plugin/iamutil/resource_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ func TestEnabledIamResources_RelativeName(t *testing.T) {
}

if resource != nil {
if err = verifyResource(resourceType, resource.(*IamResource)); err != nil {
t.Errorf("could not verify resource for relative resource name %q: %sv", testRelName, err)
if r, ok := resource.(*IamResource); ok {
if err = verifyResource(resourceType, r); err != nil {
t.Errorf("could not verify resource for relative resource name %q: %sv", testRelName, err)
}
}
}
} else if resource != nil || err == nil {
Expand All @@ -67,9 +69,11 @@ func TestEnabledIamResources_FullName(t *testing.T) {
t.Errorf("failed to get resource for full resource name %s (type: %s): %v", testFullName, resourceType, err)
continue
}
if err = verifyResource(resourceType, resource.(*IamResource)); err != nil {
t.Errorf("could not verify resource for relative resource name %s: %v", testFullName, err)
continue
if r, ok := resource.(*IamResource); ok {
if err = verifyResource(resourceType, r); err != nil {
t.Errorf("could not verify resource for relative resource name %s: %v", testFullName, err)
continue
}
}
} else if resource != nil || err == nil {
t.Errorf("expected error for using full resource name %s (type: %s), got resource:\n %v\n", testFullName, resourceType, resource)
Expand Down

0 comments on commit 04bab41

Please sign in to comment.