Merge lp:~cerberus/nova/test_cleanup into lp:~hudson-openstack/nova/trunk

Proposed by Matt Dietz
Status: Merged
Approved by: Matt Dietz
Approved revision: 331
Merged at revision: 331
Proposed branch: lp:~cerberus/nova/test_cleanup
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 55 lines (+1/-19)
2 files modified
nova/tests/api/rackspace/fakes.py (+0/-16)
nova/tests/api/rackspace/test_servers.py (+1/-3)
To merge this branch: bzr merge lp:~cerberus/nova/test_cleanup
Reviewer Review Type Date Requested Status
Jay Pipes (community) Approve
Michael Gundlach (community) Approve
Review via email: mp+37666@code.launchpad.net

Description of the change

Cleans up a broken servers unit test

To post a comment you must log in.
Revision history for this message
Michael Gundlach (gundlach) wrote :

why is internal_id being set to a string '1' now? internal_id is supposed to be an integer, right?

also i noticed in this file's test_create_instance you have "stub_out_id_translator" -- is that still supposed to be around?

lp:~cerberus/nova/test_cleanup updated
331. By mdietz <mdietz@openstack>

Merge prop suggestions

Revision history for this message
Michael Gundlach (gundlach) wrote :

lgtm, assuming it fixes the broken test :)

review: Approve
Revision history for this message
Jay Pipes (jaypipes) wrote :

w00t.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/tests/api/rackspace/fakes.py'
2--- nova/tests/api/rackspace/fakes.py 2010-10-05 17:29:27 +0000
3+++ nova/tests/api/rackspace/fakes.py 2010-10-05 21:01:50 +0000
4@@ -80,22 +80,6 @@
5
6 stubs.Set(nova.image.service.LocalImageService, 'show', fake_image_show)
7
8-
9-def stub_out_id_translator(stubs):
10- class FakeTranslator(object):
11- def __init__(self, id_type, service_name):
12- pass
13-
14- def to_rs_id(self, id):
15- return id
16-
17- def from_rs_id(self, id):
18- return id
19-
20- stubs.Set(nova.api.rackspace._id_translator,
21- 'RackspaceAPIIdTranslator', FakeTranslator)
22-
23-
24 def stub_out_auth(stubs):
25 def fake_auth_init(self, app):
26 self.application = app
27
28=== modified file 'nova/tests/api/rackspace/test_servers.py'
29--- nova/tests/api/rackspace/test_servers.py 2010-10-05 20:14:21 +0000
30+++ nova/tests/api/rackspace/test_servers.py 2010-10-05 21:01:50 +0000
31@@ -58,7 +58,6 @@
32 fakes.stub_out_networking(self.stubs)
33 fakes.stub_out_rate_limiting(self.stubs)
34 fakes.stub_out_auth(self.stubs)
35- fakes.stub_out_id_translator(self.stubs)
36 fakes.stub_out_key_pair_funcs(self.stubs)
37 fakes.stub_out_image_service(self.stubs)
38 self.stubs.Set(nova.db.api, 'instance_get_all', return_servers)
39@@ -73,7 +72,7 @@
40 req = webob.Request.blank('/v1.0/servers/1')
41 res = req.get_response(nova.api.API())
42 res_dict = json.loads(res.body)
43- self.assertEqual(res_dict['server']['id'], '1')
44+ self.assertEqual(res_dict['server']['id'], 1)
45 self.assertEqual(res_dict['server']['name'], 'server1')
46
47 def test_get_server_list(self):
48@@ -116,7 +115,6 @@
49 self.stubs.Set(nova.network.manager.VlanManager, 'allocate_fixed_ip',
50 fake_method)
51
52- fakes.stub_out_id_translator(self.stubs)
53 body = dict(server=dict(
54 name='server_test', imageId=2, flavorId=2, metadata={},
55 personality = {}