Merge pull request #5439 from evandbrown/pubsub

provider/google: Fix Pubsub acceptance tests
This commit is contained in:
Paul Hinze 2016-03-02 18:37:31 -06:00
commit 8d31c93862
2 changed files with 6 additions and 6 deletions

View File

@ -34,8 +34,8 @@ func testAccCheckPubsubSubscriptionDestroy(s *terraform.State) error {
}
config := testAccProvider.Meta().(*Config)
_, err := config.clientPubsub.Projects.Subscriptions.Get(rs.Primary.ID).Do()
if err != nil {
sub, _ := config.clientPubsub.Projects.Subscriptions.Get(rs.Primary.ID).Do()
if sub != nil {
return fmt.Errorf("Subscription still present")
}
}
@ -56,7 +56,7 @@ func testAccPubsubSubscriptionExists(n string) resource.TestCheckFunc {
config := testAccProvider.Meta().(*Config)
_, err := config.clientPubsub.Projects.Subscriptions.Get(rs.Primary.ID).Do()
if err != nil {
return fmt.Errorf("Subscription still present")
return fmt.Errorf("Subscription does not exist")
}
return nil

View File

@ -34,8 +34,8 @@ func testAccCheckPubsubTopicDestroy(s *terraform.State) error {
}
config := testAccProvider.Meta().(*Config)
_, err := config.clientPubsub.Projects.Topics.Get(rs.Primary.ID).Do()
if err != nil {
topic, _ := config.clientPubsub.Projects.Topics.Get(rs.Primary.ID).Do()
if topic != nil {
return fmt.Errorf("Topic still present")
}
}
@ -56,7 +56,7 @@ func testAccPubsubTopicExists(n string) resource.TestCheckFunc {
config := testAccProvider.Meta().(*Config)
_, err := config.clientPubsub.Projects.Topics.Get(rs.Primary.ID).Do()
if err != nil {
return fmt.Errorf("Topic still present")
return fmt.Errorf("Topic does not exist")
}
return nil