diff options
author | spisarski <s.pisarski@cablelabs.com> | 2017-05-04 12:43:53 -0600 |
---|---|---|
committer | spisarski <s.pisarski@cablelabs.com> | 2017-05-08 09:31:16 -0600 |
commit | d1c4675e5c35257b84cd69969c6e67575faf19db (patch) | |
tree | 63ff3b41ff445b8c192ec33c0aefb913a112b613 /snaps/openstack/utils/tests/neutron_utils_tests.py | |
parent | 40c96233ca4c27de1b3d8b53187c302ddd6208a2 (diff) |
Modified code to support both Python 2.7 and 3.x
* Tested on Python 2.7.10 and 3.4.4
* Updated installation documentation
JIRA: SNAPS-30
Change-Id: I94a37d218be8ea47bbbcfb560197737430fcb3ba
Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/utils/tests/neutron_utils_tests.py')
-rw-r--r-- | snaps/openstack/utils/tests/neutron_utils_tests.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/snaps/openstack/utils/tests/neutron_utils_tests.py b/snaps/openstack/utils/tests/neutron_utils_tests.py index 5f95fc9..9a043e3 100644 --- a/snaps/openstack/utils/tests/neutron_utils_tests.py +++ b/snaps/openstack/utils/tests/neutron_utils_tests.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Cable Television Laboratories, Inc. ("CableLabs") +# Copyright (c) 2017 Cable Television Laboratories, Inc. ("CableLabs") # and others. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -109,14 +109,16 @@ class NeutronUtilsNetworkTests(OSComponentTestCase): Tests the neutron_utils.create_neutron_net() function with an empty network name """ with self.assertRaises(Exception): - self.network = neutron_utils.create_network(self.neutron, NetworkSettings(name='')) + self.network = neutron_utils.create_network(self.neutron, self.os_creds, + network_settings=NetworkSettings(name='')) def test_create_network_null_name(self): """ Tests the neutron_utils.create_neutron_net() function when the network name is None """ with self.assertRaises(Exception): - self.network = neutron_utils.create_network(self.neutron, NetworkSettings()) + self.network = neutron_utils.create_network(self.neutron, self.os_creds, + network_settings=NetworkSettings()) class NeutronUtilsSubnetTests(OSComponentTestCase): @@ -644,7 +646,7 @@ def validate_port(neutron, port_obj, this_port_name): :return: True/False """ ports = neutron.list_ports() - for port, port_insts in ports.iteritems(): + for port, port_insts in ports.items(): for inst in port_insts: if inst['id'] == port_obj['port']['id']: return inst['name'] == this_port_name |