Skip to content

Commit

Permalink
Updated and fixed test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseaukeman committed Jun 26, 2018
1 parent 1eeea37 commit 43ea438
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions aws/data_source_aws_route_tables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ func TestAccDataSourceAwsRouteTables(t *testing.T) {
{
Config: testAccDataSourceAwsRouteTablesConfigWithDataSource(rInt),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.aws_route_tables.selected", "ids.#", "3"),
resource.TestCheckResourceAttr("data.aws_route_tables.test", "ids.#", "4"),
resource.TestCheckResourceAttr("data.aws_route_tables.private", "ids.#", "2"),
resource.TestCheckResourceAttr("data.aws_route_tables.test2", "ids.#", "1"),
),
},
},
Expand All @@ -39,6 +40,14 @@ resource "aws_vpc" "test" {
}
}
resource "aws_vpc" "test2" {
cidr_block = "172.%d.0.0/16"
tags {
Name = "terraform-test2acc-route-tables-data-source"
}
}
resource "aws_route_table" "test_public_a" {
vpc_id = "${aws_vpc.test.id}"
Expand Down Expand Up @@ -66,17 +75,21 @@ resource "aws_route_table" "test_private_b" {
}
}
data "aws_route_tables" "selected" {
data "aws_route_tables" "test" {
vpc_id = "${aws_vpc.test.id}"
}
data "aws_route_tables" "test2" {
vpc_id = "${aws_vpc.test2.id}"
}
data "aws_route_tables" "private" {
vpc_id = "${aws_vpc.test.id}"
tags {
Tier = "Private"
}
}
`, rInt)
`, rInt, rInt)
}

func testAccDataSourceAwsRouteTablesConfig(rInt int) string {
Expand Down

0 comments on commit 43ea438

Please sign in to comment.