summaryrefslogtreecommitdiffstats
path: root/tests/unit/test_network_utils.py
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2013-01-23 09:59:46 -0500
committerMonty Taylor <mordred@inaugust.com>2013-01-24 16:30:26 +1100
commit8c80224ecb5194a5e2ed5f74f1c7f457202d21a3 (patch)
treea557a9524e402e8cd98da702ea805c1cf8d430bb /tests/unit/test_network_utils.py
parent3d2800087ce38ff954c50e5a86916784682ed1bd (diff)
downloadoslo-8c80224ecb5194a5e2ed5f74f1c7f457202d21a3.tar.gz
oslo-8c80224ecb5194a5e2ed5f74f1c7f457202d21a3.tar.xz
oslo-8c80224ecb5194a5e2ed5f74f1c7f457202d21a3.zip
Replace direct use of testtools BaseTestCase.
Using the BaseTestCase across the tests in the tree lets us put in log fixtures and consistently handle mox and stubout. Part of blueprint grizzly-testtools. Change-Id: Iba7eb2c63b0c514009b2c28e5930b27726a147b0
Diffstat (limited to 'tests/unit/test_network_utils.py')
-rw-r--r--tests/unit/test_network_utils.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/tests/unit/test_network_utils.py b/tests/unit/test_network_utils.py
index b5b649a..c20711a 100644
--- a/tests/unit/test_network_utils.py
+++ b/tests/unit/test_network_utils.py
@@ -15,28 +15,30 @@
# License for the specific language governing permissions and limitations
# under the License.
-import testtools
-
import mock
-from openstack.common import network_utils as utils
+from openstack.common import network_utils
+from tests import utils
-class NetworkUtilsTest(testtools.TestCase):
+class NetworkUtilsTest(utils.BaseTestCase):
def test_parse_host_port(self):
self.assertEqual(('server01', 80),
- utils.parse_host_port('server01:80'))
+ network_utils.parse_host_port('server01:80'))
self.assertEqual(('server01', None),
- utils.parse_host_port('server01'))
+ network_utils.parse_host_port('server01'))
self.assertEqual(('server01', 1234),
- utils.parse_host_port('server01', default_port=1234))
+ network_utils.parse_host_port('server01',
+ default_port=1234))
self.assertEqual(('::1', 80),
- utils.parse_host_port('[::1]:80'))
+ network_utils.parse_host_port('[::1]:80'))
self.assertEqual(('::1', None),
- utils.parse_host_port('[::1]'))
+ network_utils.parse_host_port('[::1]'))
self.assertEqual(('::1', 1234),
- utils.parse_host_port('[::1]', default_port=1234))
+ network_utils.parse_host_port('[::1]',
+ default_port=1234))
self.assertEqual(('2001:db8:85a3::8a2e:370:7334', 1234),
- utils.parse_host_port('2001:db8:85a3::8a2e:370:7334',
- default_port=1234))
+ network_utils.parse_host_port(
+ '2001:db8:85a3::8a2e:370:7334',
+ default_port=1234))