summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorStephanie Reese <reese.sm@gmail.com>2011-07-15 06:52:32 +0000
committerTarmac <>2011-07-15 06:52:32 +0000
commitad700b0ecec0ffd8ed9c08caeb8f1f75fc4b482f (patch)
treea7c99d8f6437ccdb713146b944458bca37dfce91 /nova/tests
parent168a2184b462b0cd8e09da3c3962146fcb6f3665 (diff)
parent0aeec37c27e91d031ef53eeec9952c4f470990a1 (diff)
Fixes Bug #810149 that had an incomplete regex
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/api/openstack/test_common.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/nova/tests/api/openstack/test_common.py b/nova/tests/api/openstack/test_common.py
index 7440bccfb..4c4d03995 100644
--- a/nova/tests/api/openstack/test_common.py
+++ b/nova/tests/api/openstack/test_common.py
@@ -206,12 +206,36 @@ class MiscFunctionsTest(test.TestCase):
actual = common.remove_version_from_href(fixture)
self.assertEqual(actual, expected)
+ def test_remove_version_from_href_3(self):
+ fixture = 'http://www.testsite.com/v10.10'
+ expected = 'http://www.testsite.com'
+ actual = common.remove_version_from_href(fixture)
+ self.assertEqual(actual, expected)
+
+ def test_remove_version_from_href_4(self):
+ fixture = 'http://www.testsite.com/v1.1/images/v10.5'
+ expected = 'http://www.testsite.com/images/v10.5'
+ actual = common.remove_version_from_href(fixture)
+ self.assertEqual(actual, expected)
+
def test_remove_version_from_href_bad_request(self):
fixture = 'http://www.testsite.com/1.1/images'
self.assertRaises(ValueError,
common.remove_version_from_href,
fixture)
+ def test_remove_version_from_href_bad_request_2(self):
+ fixture = 'http://www.testsite.com/v/images'
+ self.assertRaises(ValueError,
+ common.remove_version_from_href,
+ fixture)
+
+ def test_remove_version_from_href_bad_request_3(self):
+ fixture = 'http://www.testsite.com/v1.1images'
+ self.assertRaises(ValueError,
+ common.remove_version_from_href,
+ fixture)
+
def test_get_id_from_href(self):
fixture = 'http://www.testsite.com/dir/45'
actual = common.get_id_from_href(fixture)