Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
louy committed Jun 3, 2018
1 parent 4303378 commit 9fe4f55
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
8 changes: 0 additions & 8 deletions uptimerobot/data_source_uptimerobot_account_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package uptimerobot

import (
"fmt"
"testing"

"github.com/hashicorp/terraform/helper/resource"
Expand All @@ -21,13 +20,6 @@ func TestUptimeRobotDataSourceAccount_basic(t *testing.T) {
resource.TestCheckResourceAttrSet("data.uptimerobot_account.test", "up_monitors"),
resource.TestCheckResourceAttrSet("data.uptimerobot_account.test", "down_monitors"),
resource.TestCheckResourceAttrSet("data.uptimerobot_account.test", "paused_monitors"),
testCheckStateValue("data.uptimerobot_account.test", "email", func(v string) error {
if v == "" {
return fmt.Errorf(
"Value for %s is empty", "email")
}
return nil
}),
),
},
},
Expand Down
18 changes: 0 additions & 18 deletions uptimerobot/provider_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package uptimerobot

import (
"fmt"
"os"
"testing"

"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/terraform"
)
Expand Down Expand Up @@ -34,19 +32,3 @@ func testAccPreCheck(t *testing.T) {
t.Fatal("UPTIMEROBOT_API_KEY must be set for acceptance tests")
}
}

func testCheckStateValue(id, name string, runAssertions func(value string) error) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[id]
if !ok {
return fmt.Errorf("Not found: %s", id)
}
if rs.Primary.ID == "" {
return fmt.Errorf("No ID is set")
}

v := rs.Primary.Attributes[name]

return runAssertions(v)
}
}

0 comments on commit 9fe4f55

Please sign in to comment.