diff --git a/atst/domain/csp/cloud.py b/atst/domain/csp/cloud.py index 529897ad..c498a1fe 100644 --- a/atst/domain/csp/cloud.py +++ b/atst/domain/csp/cloud.py @@ -8,6 +8,12 @@ class CloudProviderInterface: """ raise NotImplementedError() + def delete_application(self, cloud_id): # pragma: no cover + """Delete an application in the cloud with the provided cloud_id. Returns + True for success or raises an error. + """ + raise NotImplementedError() + def create_user(self, user): # pragma: no cover """Create an account in the CSP for specified user. Returns the ID of the created user. @@ -49,6 +55,11 @@ class MockCloudProvider(CloudProviderInterface): cloud.""" return uuid4().hex + def delete_application(self, name): + """Returns an id that represents what would be an application in the + cloud.""" + return True + def create_user(self, user): """Returns an id that represents what would be an user in the cloud.""" return uuid4().hex diff --git a/atst/domain/environments.py b/atst/domain/environments.py index 367646fa..5e7102b1 100644 --- a/atst/domain/environments.py +++ b/atst/domain/environments.py @@ -111,4 +111,6 @@ class Environments(object): if commit: db.session.commit() + app.csp.cloud.delete_application(environment.cloud_id) + return environment