def test_remove_tenants_missing_tenants(self, mock_logger_debug):
     with mock.patch(
             'functest.utils.openstack_clean.os_utils'
             '.get_tenants',
             return_value=None):
         openstack_clean.remove_tenants(self.client, self.update_list)
         mock_logger_debug.assert_any_call("Removing Tenants...")
         mock_logger_debug.assert_any_call("There are no tenants in"
                                           " the deployment. ")
 def test_remove_tenants(self, mock_logger_debug):
     with mock.patch(
             'functest.utils.openstack_clean.os_utils'
             '.get_tenants',
             return_value=self.test_list):
         openstack_clean.remove_tenants(self.client, self.update_list)
         mock_logger_debug.assert_any_call("Removing Tenants...")
         mock_logger_debug.assert_any_call("   > this is a default"
                                           " tenant and will "
                                           "NOT be deleted.")
 def test_remove_tenants_delete_success(self, mock_logger_debug):
     with mock.patch('functest.utils.openstack_clean.os_utils'
                     '.get_tenants', return_value=self.test_list), \
             mock.patch('functest.utils.openstack_clean.os_utils'
                        '.delete_tenant', return_value=True):
         openstack_clean.remove_tenants(self.client, self.remove_list)
         mock_logger_debug.assert_any_call("Removing Tenants...")
         mock_logger_debug.assert_any_call("  > Done!")
         mock_logger_debug.assert_any_call(
             test_utils.RegexMatch(" Removing "
                                   "\s*\S+..."))
 def test_remove_tenants_delete_failed(self, mock_logger_debug,
                                       mock_logger_error):
     with mock.patch('functest.utils.openstack_clean.os_utils'
                     '.get_tenants', return_value=self.test_list), \
             mock.patch('functest.utils.openstack_clean.os_utils'
                        '.delete_tenant', return_value=False):
         openstack_clean.remove_tenants(self.client, self.remove_list)
         mock_logger_debug.assert_any_call("Removing Tenants...")
         mock_logger_error.assert_any_call(
             test_utils.RegexMatch("There has been a "
                                   "problem removing "
                                   "the tenant \s*\S+"
                                   "..."))
         mock_logger_debug.assert_any_call(
             test_utils.RegexMatch(" Removing "
                                   "\s*\S+..."))