summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wolf <throughnothing@gmail.com>2011-07-15 09:57:28 -0400
committerWilliam Wolf <throughnothing@gmail.com>2011-07-15 09:57:28 -0400
commit8d0ab9a9e927a82160f668ead2bd4daff481796c (patch)
tree207777c273575e30af8aed45076aa02f716623f1
parent6cbce0442cf15d31e7ab05b808939bdc3a244f1b (diff)
fix issues with uuid and old tests
-rw-r--r--nova/tests/api/openstack/test_servers.py44
1 files changed, 20 insertions, 24 deletions
diff --git a/nova/tests/api/openstack/test_servers.py b/nova/tests/api/openstack/test_servers.py
index 01dec3f5f..87f5e8e6b 100644
--- a/nova/tests/api/openstack/test_servers.py
+++ b/nova/tests/api/openstack/test_servers.py
@@ -349,17 +349,17 @@ class ServersTest(test.TestCase):
"links": [
{
"rel": "self",
- "href": "http://localhost/v1.1/servers/1",
+ "href": "http://localhost/v1.1/servers/%s" % (FAKE_UUID),
},
{
"rel": "bookmark",
- "href": "http://localhost/servers/1",
+ "href": "http://localhost/servers/%s" % (FAKE_UUID),
},
],
}
}
- self.assertDictEqual(res_dict, expected_server)
+ self.assertDictMatch(res_dict, expected_server)
def test_get_server_with_active_status_by_id_v1_1(self):
self.maxDiff = None
@@ -432,17 +432,17 @@ class ServersTest(test.TestCase):
"links": [
{
"rel": "self",
- "href": "http://localhost/v1.1/servers/1",
+ "href": "http://localhost/v1.1/servers/%s" % (FAKE_UUID),
},
{
"rel": "bookmark",
- "href": "http://localhost/servers/1",
+ "href": "http://localhost/servers/%s" % (FAKE_UUID),
},
],
}
}
- self.assertDictEqual(res_dict, expected_server)
+ self.assertDictMatch(res_dict, expected_server)
def test_get_server_with_id_image_ref_by_id_v1_1(self):
self.maxDiff = None
@@ -517,17 +517,17 @@ class ServersTest(test.TestCase):
"links": [
{
"rel": "self",
- "href": "http://localhost/v1.1/servers/1",
+ "href": "http://localhost/v1.1/servers/%s" % (FAKE_UUID),
},
{
"rel": "bookmark",
- "href": "http://localhost/servers/1",
+ "href": "http://localhost/servers/%s" % (FAKE_UUID),
},
],
}
}
- self.assertDictEqual(res_dict, expected_server)
+ self.assertDictMatch(res_dict, expected_server)
def test_get_server_by_id_with_addresses_xml(self):
private = "192.168.0.3"
@@ -736,17 +736,17 @@ class ServersTest(test.TestCase):
self.assertEqual(s.get('image', None), None)
expected_links = [
- {
- "rel": "self",
- "href": "http://localhost/v1.1/servers/%d" % (i,),
- },
- {
- "rel": "bookmark",
- "href": "http://localhost/servers/%d" % (i,),
- },
- ]
+ {
+ "rel": "self",
+ "href": "http://localhost/v1.1/servers/%s" % (FAKE_UUID),
+ },
+ {
+ "rel": "bookmark",
+ "href": "http://localhost/servers/%s" % (FAKE_UUID),
+ },
+ ]
- self.assertEqual(s['links'], expected_links)
+ self.assertEqual(s['links'], expected_links)
def test_get_servers_with_limit(self):
req = webob.Request.blank('/v1.0/servers?limit=3')
@@ -2656,8 +2656,4 @@ class ServersTestv1_1(test.TestCase):
}
}
- import pprint
- pp = pprint.PrettyPrinter()
- pp.pprint(res_dict)
- pp.pprint(expected_server)
- self.assertDictEqual(res_dict, expected_server)
+ self.assertDictMatch(res_dict, expected_server)