-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #459 from ekristen/fix-ec2-tgw
fix(ec2-tgw): filter out gateways not owned by account
- Loading branch information
Showing
2 changed files
with
54 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package resources | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/gotidy/ptr" | ||
"github.com/stretchr/testify/assert" | ||
|
||
"github.com/aws/aws-sdk-go/service/ec2" | ||
) | ||
|
||
func Test_EC2TGW_Properties(t *testing.T) { | ||
tgw := &EC2TGW{ | ||
ID: ptr.String("tgw-1234567890abcdef0"), | ||
OwnerID: ptr.String("123456789012"), | ||
Tags: []*ec2.Tag{ | ||
{ | ||
Key: ptr.String("TestTag"), | ||
Value: ptr.String("test-tgw"), | ||
}, | ||
}, | ||
} | ||
|
||
assert.Equal(t, "tgw-1234567890abcdef0", tgw.Properties().Get("ID")) | ||
assert.Equal(t, "123456789012", tgw.Properties().Get("OwnerId")) | ||
assert.Equal(t, "test-tgw", tgw.Properties().Get("tag:TestTag")) | ||
assert.Equal(t, "tgw-1234567890abcdef0", tgw.String()) | ||
} |