summaryrefslogtreecommitdiff
path: root/novaclient/tests/unit/v2/contrib/test_cells.py
diff options
context:
space:
mode:
Diffstat (limited to 'novaclient/tests/unit/v2/contrib/test_cells.py')
-rw-r--r--novaclient/tests/unit/v2/contrib/test_cells.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/novaclient/tests/unit/v2/contrib/test_cells.py b/novaclient/tests/unit/v2/contrib/test_cells.py
new file mode 100644
index 0000000..e411502
--- /dev/null
+++ b/novaclient/tests/unit/v2/contrib/test_cells.py
@@ -0,0 +1,42 @@
1# Copyright 2013 Rackspace Hosting
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
16from novaclient import extension
17from novaclient.tests.unit import utils
18from novaclient.tests.unit.v2.contrib import fakes
19from novaclient.v2.contrib import cells
20
21
22extensions = [
23 extension.Extension(cells.__name__.split(".")[-1],
24 cells),
25]
26cs = fakes.FakeClient(extensions=extensions)
27
28
29class CellsExtensionTests(utils.TestCase):
30 def test_get_cells(self):
31 cell_name = 'child_cell'
32 cs.cells.get(cell_name)
33 cs.assert_called('GET', '/os-cells/%s' % cell_name)
34
35 def test_get_capacities_for_a_given_cell(self):
36 cell_name = 'child_cell'
37 cs.cells.capacities(cell_name)
38 cs.assert_called('GET', '/os-cells/%s/capacities' % cell_name)
39
40 def test_get_capacities_for_all_cells(self):
41 cs.cells.capacities()
42 cs.assert_called('GET', '/os-cells/capacities')