Test delition of repository
This commit is contained in:
parent
32b5493e57
commit
60351421da
|
@ -36,6 +36,22 @@ func TestAccBitbucketRepository_basic(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func testAccCheckBitbucketRepositoryDestroy(s *terraform.State) error {
|
func testAccCheckBitbucketRepositoryDestroy(s *terraform.State) error {
|
||||||
|
client := testAccProvider.Meta().(*BitbucketClient)
|
||||||
|
rs, ok := s.RootModule().Resources["bitbucket_repository.test_repo"]
|
||||||
|
if !ok {
|
||||||
|
return fmt.Errorf("Not found %s", "bitbucket_repository.test_repo")
|
||||||
|
}
|
||||||
|
|
||||||
|
response, err := client.Get(fmt.Sprintf("2.0/repositories/%s/%s", rs.Primary.Attributes["owner"], rs.Primary.Attributes["name"]))
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if response.StatusCode != 404 {
|
||||||
|
return fmt.Errorf("Repository still exists")
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue