From e3f71de9783e8433d5cfaf36724a57636b2ba765 Mon Sep 17 00:00:00 2001 From: Arx Cruz Date: Wed, 7 Jan 2015 10:44:55 +0100 Subject: [PATCH] Python 3 fix '+' operand in dict in test_osclients.py In Python 3, the dict.items() return a dict_items object, which does not support the + operand. The way to make it compatible is using the update method in dict object. Change-Id: I99c94b9a2d99d54de5a93a4e15e82ab0173e5592 --- tests/unit/test_osclients.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_osclients.py b/tests/unit/test_osclients.py index 44df4929b5..48bd70a9e8 100644 --- a/tests/unit/test_osclients.py +++ b/tests/unit/test_osclients.py @@ -63,7 +63,8 @@ class OSClientsTestCase(test.TestCase): endpoint = {"timeout": cfg.CONF.openstack_client_http_timeout, "insecure": False, "cacert": None, "endpoint": auth_url} - kwargs = dict(self.endpoint.to_dict().items() + endpoint.items()) + kwargs = self.endpoint.to_dict() + kwargs.update(endpoint.items()) self.mock_create_keystone_client.assert_called_once_with(kwargs) self.assertEqual(self.clients.cache["keystone"], self.fake_keystone) @@ -74,7 +75,8 @@ class OSClientsTestCase(test.TestCase): endpoint = {"timeout": cfg.CONF.openstack_client_http_timeout, "insecure": False, "cacert": None, "endpoint": self.endpoint_https.auth_url} - kwargs = dict(self.endpoint_https.to_dict().items() + endpoint.items()) + kwargs = self.endpoint_https.to_dict() + kwargs.update(endpoint.items()) self.mock_create_keystone_client.assert_called_once_with(kwargs) self.assertEqual(self.clients_https.cache["keystone"], self.fake_keystone)