def test_destroy_tenants(self): fake_tenant = self.fake_object["tenant"] fake_auth = self.fake_client self.useFixture(mockpatch.Patch("tempest.common.identity.get_tenant_by_name", return_value=fake_tenant)) self.useFixture(mockpatch.PatchObject(javelin, "keystone_admin", return_value=fake_auth)) javelin.destroy_tenants([fake_tenant]) mocked_function = fake_auth.identity.delete_tenant mocked_function.assert_called_once_with(fake_tenant["id"])
def test_destroy_tenants(self): fake_tenant = self.fake_object['tenant'] fake_auth = self.fake_client fake_auth.identity.get_tenant_by_name.return_value = fake_tenant self.useFixture(mockpatch.PatchObject(javelin, "keystone_admin", return_value=fake_auth)) javelin.destroy_tenants([fake_tenant]) mocked_function = fake_auth.identity.delete_tenant mocked_function.assert_called_once_with(fake_tenant['id'])
def test_destroy_tenants(self): fake_tenant = self.fake_object['tenant'] fake_auth = mock.MagicMock() fake_auth.identity.get_tenant_by_name.return_value = fake_tenant self.useFixture(mockpatch.PatchObject(javelin, "keystone_admin", return_value=fake_auth)) javelin.destroy_tenants([fake_tenant]) mocked_function = fake_auth.identity.delete_tenant mocked_function.assert_called_once_with(fake_tenant['id'])