diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-06-26 11:42:23 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-06-26 11:42:23 +0000 |
commit | e9f567c8ed31d71002b7e3149aeea274e42b9321 (patch) | |
tree | 3b1a87432bb1940172600aa6929fb32388e82b74 /tests | |
parent | b7b4dbc41c4b361ca1afcc8ded0d47f78b53a131 (diff) | |
parent | 0bf03b753c45dd3663a0839bb0ad15187a517bf3 (diff) | |
download | oslo-e9f567c8ed31d71002b7e3149aeea274e42b9321.tar.gz oslo-e9f567c8ed31d71002b7e3149aeea274e42b9321.tar.xz oslo-e9f567c8ed31d71002b7e3149aeea274e42b9321.zip |
Merge "Add network_utils.urlsplit"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/test_network_utils.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/unit/test_network_utils.py b/tests/unit/test_network_utils.py index 2783e70..4ac0222 100644 --- a/tests/unit/test_network_utils.py +++ b/tests/unit/test_network_utils.py @@ -40,3 +40,20 @@ class NetworkUtilsTest(utils.BaseTestCase): network_utils.parse_host_port( '2001:db8:85a3::8a2e:370:7334', default_port=1234)) + + def test_urlsplit(self): + result = network_utils.urlsplit('rpc://myhost?someparam#somefragment') + self.assertEqual(result.scheme, 'rpc') + self.assertEqual(result.netloc, 'myhost') + self.assertEqual(result.path, '') + self.assertEqual(result.query, 'someparam') + self.assertEqual(result.fragment, 'somefragment') + + result = network_utils.urlsplit( + 'rpc://myhost/mypath?someparam#somefragment', + allow_fragments=False) + self.assertEqual(result.scheme, 'rpc') + self.assertEqual(result.netloc, 'myhost') + self.assertEqual(result.path, '/mypath') + self.assertEqual(result.query, 'someparam#somefragment') + self.assertEqual(result.fragment, '') |