Skip to content

Commit

Permalink
add acceptance test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
anGie44 committed Jan 21, 2022
1 parent 857d702 commit ca4db91
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions internal/service/ec2/vpc_peering_connections_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ func TestAccEC2VPCPeeringConnectionsDataSource_basic(t *testing.T) {
})
}

func TestAccEC2VPCPeeringConnectionsDataSource_NoMatches(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID),
ProviderFactories: acctest.ProviderFactories,
Steps: []resource.TestStep{
{
Config: testAccVPCPeeringConnectionsDataSourceConfig_NoMatches,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.aws_vpc_peering_connections.test", "ids.#", "0"),
),
},
},
})
}

const testAccVPCPeeringConnectionsDataSourceConfig = `
resource "aws_vpc" "foo" {
cidr_block = "10.1.0.0/16"
Expand Down Expand Up @@ -81,3 +97,11 @@ data "aws_vpc_peering_connections" "test_by_filters" {
}
}
`

const testAccVPCPeeringConnectionsDataSourceConfig_NoMatches = `
data "aws_vpc_peering_connections" "test" {
tags = {
Name = "Non-Existent"
}
}
`

0 comments on commit ca4db91

Please sign in to comment.