diff --git a/tests/test_auth_plugins.py b/tests/test_auth_plugins.py index 85d220b25..fae63247b 100644 --- a/tests/test_auth_plugins.py +++ b/tests/test_auth_plugins.py @@ -48,7 +48,7 @@ def mock_http_request(resp=None): { "region": "RegionOne", "adminURL": "http://localhost:8774/v1.1", - "internalURL":"http://localhost:8774/v1.1", + "internalURL": "http://localhost:8774/v1.1", "publicURL": "http://localhost:8774/v1.1/", }, ], diff --git a/tests/v1_1/contrib/test_baremetal.py b/tests/v1_1/contrib/test_baremetal.py index 3bf121ead..6925f18db 100644 --- a/tests/v1_1/contrib/test_baremetal.py +++ b/tests/v1_1/contrib/test_baremetal.py @@ -61,5 +61,5 @@ class BaremetalExtensionTest(utils.TestCase): cs.assert_called('POST', '/os-baremetal-nodes/1/action') def test_node_list_interfaces(self): - il = cs.baremetal.list_interfaces(1) + cs.baremetal.list_interfaces(1) cs.assert_called('GET', '/os-baremetal-nodes/1') diff --git a/tests/v1_1/contrib/test_tenant_networks.py b/tests/v1_1/contrib/test_tenant_networks.py index a96a83149..a79f76dd1 100644 --- a/tests/v1_1/contrib/test_tenant_networks.py +++ b/tests/v1_1/contrib/test_tenant_networks.py @@ -36,7 +36,7 @@ class TenantNetworkExtensionTests(utils.TestCase): self.assertTrue(len(nets) > 0) def test_get_tenant_network(self): - net = cs.tenant_networks.get(1) + cs.tenant_networks.get(1) cs.assert_called('GET', '/os-tenant-networks/1') def test_create_tenant_networks(self): diff --git a/tests/v1_1/test_auth.py b/tests/v1_1/test_auth.py index 85dd4e4de..f5ddf35f8 100644 --- a/tests/v1_1/test_auth.py +++ b/tests/v1_1/test_auth.py @@ -125,7 +125,7 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase): } correct_response = json.dumps(dict_correct_response) dict_responses = [ - {"headers": {'location':'http://127.0.0.1:5001'}, + {"headers": {'location': 'http://127.0.0.1:5001'}, "status_code": 305, "text": "Use proxy"}, # Configured on admin port, nova redirects to v2.0 port. diff --git a/tests/v1_1/utils.py b/tests/v1_1/utils.py index f878a5e26..eaf108f55 100644 --- a/tests/v1_1/utils.py +++ b/tests/v1_1/utils.py @@ -20,7 +20,7 @@ def assert_has_keys(dict, required=[], optional=[]): for k in required: assert_in(k, keys, "required key %s missing from %s" % (k, dict)) allowed_keys = set(required) | set(optional) - extra_keys = set(keys).difference(set(required + optional)) + extra_keys = set(keys).difference(allowed_keys) if extra_keys: fail("found unexpected keys: %s" % list(extra_keys))