summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-06-29 23:38:53 +0000
committerGerrit Code Review <review@openstack.org>2013-06-29 23:38:53 +0000
commit43849d18fd2fa8a298840a73b7756f3a346f2e6c (patch)
tree1155f881345a40f562a4d1015006d2ff7765a5d8 /nova/tests
parent94aad08cfbefb19ec0bb995cac8c8f30e974e214 (diff)
parent124fbf3990b4595da912f8f3a1e939ae728a106b (diff)
Merge "Port cells extension to v3 API Part 2"
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/api/openstack/compute/plugins/v3/test_cells.py11
-rw-r--r--nova/tests/fake_policy.py1
2 files changed, 4 insertions, 8 deletions
diff --git a/nova/tests/api/openstack/compute/plugins/v3/test_cells.py b/nova/tests/api/openstack/compute/plugins/v3/test_cells.py
index a9e77693e..f369c06e3 100644
--- a/nova/tests/api/openstack/compute/plugins/v3/test_cells.py
+++ b/nova/tests/api/openstack/compute/plugins/v3/test_cells.py
@@ -18,7 +18,7 @@ import copy
from lxml import etree
from webob import exc
-from nova.api.openstack.compute.contrib import cells as cells_ext
+from nova.api.openstack.compute.plugins.v3 import cells as cells_ext
from nova.api.openstack import extensions
from nova.api.openstack import xmlutil
from nova.cells import rpcapi as cells_rpcapi
@@ -88,12 +88,11 @@ class CellsTest(test.TestCase):
self.stubs.Set(cells_rpcapi.CellsAPI, 'get_cell_info_for_neighbors',
fake_cells_api_get_all_cell_info)
- self.ext_mgr = self.mox.CreateMock(extensions.ExtensionManager)
- self.controller = cells_ext.Controller(self.ext_mgr)
+ self.controller = cells_ext.CellsController()
self.context = context.get_admin_context()
def _get_request(self, resource):
- return fakes.HTTPRequest.blank('/v2/fake/' + resource)
+ return fakes.HTTPRequestV3.blank('/' + resource)
def test_index(self):
req = self._get_request("cells")
@@ -284,7 +283,6 @@ class CellsTest(test.TestCase):
self.assertEqual(cell_caps['cap2'], 'c;d')
def test_show_capacities(self):
- self.ext_mgr.is_loaded('os-cell-capacities').AndReturn(True)
self.mox.StubOutWithMock(self.controller.cells_rpcapi,
'get_capacities')
response = {"ram_free":
@@ -305,7 +303,6 @@ class CellsTest(test.TestCase):
self.assertEqual(response, res_dict['cell']['capacities'])
def test_show_capacity_fails_with_non_admin_context(self):
- self.ext_mgr.is_loaded('os-cell-capacities').AndReturn(True)
rules = {"compute_extension:cells": "is_admin:true"}
self.policy.set_rules(rules)
@@ -317,7 +314,6 @@ class CellsTest(test.TestCase):
self.controller.capacities, req)
def test_show_capacities_for_invalid_cell(self):
- self.ext_mgr.is_loaded('os-cell-capacities').AndReturn(True)
self.mox.StubOutWithMock(self.controller.cells_rpcapi,
'get_capacities')
self.controller.cells_rpcapi. \
@@ -330,7 +326,6 @@ class CellsTest(test.TestCase):
self.controller.capacities, req, "invalid_cell")
def test_show_capacities_for_cell(self):
- self.ext_mgr.is_loaded('os-cell-capacities').AndReturn(True)
self.mox.StubOutWithMock(self.controller.cells_rpcapi,
'get_capacities')
response = {"ram_free":
diff --git a/nova/tests/fake_policy.py b/nova/tests/fake_policy.py
index da43115d0..490ef5bc5 100644
--- a/nova/tests/fake_policy.py
+++ b/nova/tests/fake_policy.py
@@ -111,6 +111,7 @@ policy_data = """
"compute_extension:attach_interfaces": "",
"compute_extension:baremetal_nodes": "",
"compute_extension:cells": "",
+ "compute_extension:v3:os-cells": "",
"compute_extension:certificates": "",
"compute_extension:v3:os-certificates": "",
"compute_extension:cloudpipe": "",