summaryrefslogtreecommitdiff
path: root/novaclient/tests/unit/v2/contrib/test_list_extensions.py
diff options
context:
space:
mode:
Diffstat (limited to 'novaclient/tests/unit/v2/contrib/test_list_extensions.py')
-rw-r--r--novaclient/tests/unit/v2/contrib/test_list_extensions.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/novaclient/tests/unit/v2/contrib/test_list_extensions.py b/novaclient/tests/unit/v2/contrib/test_list_extensions.py
new file mode 100644
index 0000000..3fa5253
--- /dev/null
+++ b/novaclient/tests/unit/v2/contrib/test_list_extensions.py
@@ -0,0 +1,33 @@
1#
2# Licensed under the Apache License, Version 2.0 (the "License"); you may
3# not use this file except in compliance with the License. You may obtain
4# a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11# License for the specific language governing permissions and limitations
12# under the License.
13
14from novaclient import extension
15from novaclient.tests.unit import utils
16from novaclient.tests.unit.v2 import fakes
17from novaclient.v2.contrib import list_extensions
18
19
20extensions = [
21 extension.Extension(list_extensions.__name__.split(".")[-1],
22 list_extensions),
23]
24cs = fakes.FakeClient(extensions=extensions)
25
26
27class ListExtensionsTests(utils.TestCase):
28 def test_list_extensions(self):
29 all_exts = cs.list_extensions.show_all()
30 cs.assert_called('GET', '/extensions')
31 self.assertTrue(len(all_exts) > 0)
32 for r in all_exts:
33 self.assertTrue(len(r.summary) > 0)