summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/common/test_project_cleanup.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/tests/unit/common/test_project_cleanup.py')
-rw-r--r--openstackclient/tests/unit/common/test_project_cleanup.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/common/test_project_cleanup.py b/openstackclient/tests/unit/common/test_project_cleanup.py
index d235aeb0..50c434b9 100644
--- a/openstackclient/tests/unit/common/test_project_cleanup.py
+++ b/openstackclient/tests/unit/common/test_project_cleanup.py
@@ -85,6 +85,32 @@ class TestProjectCleanup(TestProjectCleanupBase):
self.assertIsNone(result)
+ def test_project_cleanup_with_auto_approve(self):
+ arglist = [
+ '--project', self.project.id,
+ '--auto-approve',
+ ]
+ verifylist = [
+ ('dry_run', False),
+ ('auth_project', False),
+ ('project', self.project.id),
+ ('auto_approve', True),
+ ]
+ parsed_args = self.check_parser(self.cmd, arglist, verifylist)
+ result = None
+
+ result = self.cmd.take_action(parsed_args)
+
+ self.sdk_connect_as_project_mock.assert_called_with(
+ self.project)
+ calls = [
+ mock.call(dry_run=True, status_queue=mock.ANY, filters={}),
+ mock.call(dry_run=False, status_queue=mock.ANY, filters={})
+ ]
+ self.project_cleanup_mock.assert_has_calls(calls)
+
+ self.assertIsNone(result)
+
def test_project_cleanup_with_project(self):
arglist = [
'--project', self.project.id,