Skip to content

Commit

Permalink
removing redundant import state tests from resource_integer_test
Browse files Browse the repository at this point in the history
  • Loading branch information
mildwonkey committed May 21, 2018
1 parent 5a63bc3 commit 32b7317
Showing 1 changed file with 4 additions and 40 deletions.
44 changes: 4 additions & 40 deletions random/resource_integer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,12 @@ func TestAccResourceIntegerUpdate(t *testing.T) {
testAccResourceIntegerBasic("random_integer.integer_1"),
),
},
{
ResourceName: "random_integer.integer_1",
ImportState: true,
ImportStateId: "3,1,3,12345",
ImportStateVerify: true,
},
{
Config: testRandomIntegerUpdate,
Check: resource.ComposeTestCheckFunc(
testAccResourceIntegerUpdate("random_integer.integer_1"),
),
},
{
ResourceName: "random_integer.integer_1",
ImportState: true,
ImportStateId: "2,1,3,123456",
ImportStateVerify: true,
},
},
})
}
Expand All @@ -76,24 +64,12 @@ func TestAccResourceIntegerSeedless_to_seeded(t *testing.T) {
testAccResourceIntegerSeedless("random_integer.integer_1"),
),
},
{
ResourceName: "random_integer.integer_1",
ImportState: true,
ImportStateId: "3,1,3",
ImportStateVerify: true,
},
{
Config: testRandomIntegerUpdate,
Check: resource.ComposeTestCheckFunc(
testAccResourceIntegerUpdate("random_integer.integer_1"),
),
},
{
ResourceName: "random_integer.integer_1",
ImportState: true,
ImportStateId: "2,1,3,123456",
ImportStateVerify: true,
},
},
})
}
Expand All @@ -110,24 +86,12 @@ func TestAccResourceIntegerSeeded_to_seedless(t *testing.T) {
testAccResourceIntegerBasic("random_integer.integer_1"),
),
},
{
ResourceName: "random_integer.integer_1",
ImportState: true,
ImportStateId: "3,1,3,12345",
ImportStateVerify: true,
},
{
Config: testRandomIntegerSeedless,
Check: resource.ComposeTestCheckFunc(
testAccResourceIntegerSeedless("random_integer.integer_1"),
),
},
{
ResourceName: "random_integer.integer_1",
ImportState: true,
ImportStateId: "3,1,3",
ImportStateVerify: true,
},
},
})
}
Expand Down Expand Up @@ -157,10 +121,10 @@ func testAccResourceIntegerBasic(id string) resource.TestCheckFunc {

func testAccResourceIntegerUpdate(id string) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[id]
if !ok {
return fmt.Errorf("Not found: %s", id)
}
rs, _ := s.RootModule().Resources[id]
// if !ok {
// return fmt.Errorf("Not found: %s", id)
// }
result := rs.Primary.Attributes["result"]

if rs.Primary.ID == "" {
Expand Down

0 comments on commit 32b7317

Please sign in to comment.