Fix formatting of aws_test.go

pull/6/head
James Ravn 2016-01-26 15:13:25 +00:00
parent b4bbc3b3ef
commit c3383b3422
1 changed files with 22 additions and 24 deletions

View File

@ -801,27 +801,26 @@ func TestSubnetIDsinVPC(t *testing.T) {
}
func TestIpPermissionExistsHandlesMultipleGroupIds(t *testing.T) {
oldIpPermission := ec2.IpPermission {
UserIdGroupPairs: []*ec2.UserIdGroupPair {
&ec2.UserIdGroupPair{GroupId: aws.String("firstGroupId")},
&ec2.UserIdGroupPair{GroupId: aws.String("secondGroupId")},
&ec2.UserIdGroupPair{GroupId: aws.String("thirdGroupId")},
oldIpPermission := ec2.IpPermission{
UserIdGroupPairs: []*ec2.UserIdGroupPair{
{GroupId: aws.String("firstGroupId")},
{GroupId: aws.String("secondGroupId")},
{GroupId: aws.String("thirdGroupId")},
},
}
existingIpPermission := ec2.IpPermission {
UserIdGroupPairs: []*ec2.UserIdGroupPair {
&ec2.UserIdGroupPair{GroupId: aws.String("secondGroupId")},
existingIpPermission := ec2.IpPermission{
UserIdGroupPairs: []*ec2.UserIdGroupPair{
{GroupId: aws.String("secondGroupId")},
},
}
newIpPermission := ec2.IpPermission {
UserIdGroupPairs: []*ec2.UserIdGroupPair {
&ec2.UserIdGroupPair{GroupId: aws.String("fourthGroupId")},
newIpPermission := ec2.IpPermission{
UserIdGroupPairs: []*ec2.UserIdGroupPair{
{GroupId: aws.String("fourthGroupId")},
},
}
equals := ipPermissionExists(&existingIpPermission, &oldIpPermission, false)
if !equals {
t.Errorf("Should have been considered equal since first is in the second array of groups")
@ -834,27 +833,26 @@ func TestIpPermissionExistsHandlesMultipleGroupIds(t *testing.T) {
}
func TestIpPermissionExistsHandlesMultipleGroupIdsWithUserIds(t *testing.T) {
oldIpPermission := ec2.IpPermission {
UserIdGroupPairs: []*ec2.UserIdGroupPair {
&ec2.UserIdGroupPair{GroupId: aws.String("firstGroupId"), UserId: aws.String("firstUserId")},
&ec2.UserIdGroupPair{GroupId: aws.String("secondGroupId"), UserId: aws.String("secondUserId")},
&ec2.UserIdGroupPair{GroupId: aws.String("thirdGroupId"), UserId: aws.String("thirdUserId")},
oldIpPermission := ec2.IpPermission{
UserIdGroupPairs: []*ec2.UserIdGroupPair{
{GroupId: aws.String("firstGroupId"), UserId: aws.String("firstUserId")},
{GroupId: aws.String("secondGroupId"), UserId: aws.String("secondUserId")},
{GroupId: aws.String("thirdGroupId"), UserId: aws.String("thirdUserId")},
},
}
existingIpPermission := ec2.IpPermission {
UserIdGroupPairs: []*ec2.UserIdGroupPair {
&ec2.UserIdGroupPair{GroupId: aws.String("secondGroupId"), UserId: aws.String("secondUserId")},
existingIpPermission := ec2.IpPermission{
UserIdGroupPairs: []*ec2.UserIdGroupPair{
{GroupId: aws.String("secondGroupId"), UserId: aws.String("secondUserId")},
},
}
newIpPermission := ec2.IpPermission {
UserIdGroupPairs: []*ec2.UserIdGroupPair {
&ec2.UserIdGroupPair{GroupId: aws.String("secondGroupId"), UserId: aws.String("anotherUserId")},
newIpPermission := ec2.IpPermission{
UserIdGroupPairs: []*ec2.UserIdGroupPair{
{GroupId: aws.String("secondGroupId"), UserId: aws.String("anotherUserId")},
},
}
equals := ipPermissionExists(&existingIpPermission, &oldIpPermission, true)
if !equals {
t.Errorf("Should have been considered equal since first is in the second array of groups")