Skip to content

Commit

Permalink
fix code smell in TestAccUCloudInstanceState
Browse files Browse the repository at this point in the history
  • Loading branch information
wangrzneu committed Aug 27, 2023
1 parent d68110b commit b2d3594
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ucloud/resource_ucloud_instance_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
)

func TestAccUCloudInstanceState(t *testing.T) {

instanceStateResource := "ucloud_instance_state.foo"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
testAccPreCheck(t)
},

IDRefreshName: "ucloud_instance_state.foo",
IDRefreshName: instanceStateResource,
Providers: testAccProviders,
CheckDestroy: testAccCheckInstanceStateDestroy,

Expand All @@ -25,15 +25,15 @@ func TestAccUCloudInstanceState(t *testing.T) {

Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("ucloud_instance.foo", "name", "tf-acc-instance-config-basic"),
resource.TestCheckResourceAttr("ucloud_instance_state.foo", "state", "Stopped"),
resource.TestCheckResourceAttr(instanceStateResource, "state", "Stopped"),
),
},
{
Config: testAccInstanceStateConfigUpdate(),

Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("ucloud_instance.foo", "name", "tf-acc-instance-config-basic"),
resource.TestCheckResourceAttr("ucloud_instance_state.foo", "state", "Running"),
resource.TestCheckResourceAttr(instanceStateResource, "state", "Running"),
),
},
},
Expand Down

0 comments on commit b2d3594

Please sign in to comment.