
Implements the list extension functionality from novaclient written by harlowja (Change-Id: I5b72f5ea73c00f1c1a0f09f670d744c820e05837) This provides a mechanism to view available extensions, and also starts actually using the cinderclient contrib dir. Original Author: harlowja Change-Id: I4f9d04cb8a2aa05c978a2a5a926c9175ee3614bb
22 lines
605 B
Python
22 lines
605 B
Python
from cinderclient import extension
|
|
from cinderclient.v1.contrib import list_extensions
|
|
|
|
from tests import utils
|
|
from tests.v1 import fakes
|
|
|
|
|
|
extensions = [
|
|
extension.Extension(list_extensions.__name__.split(".")[-1],
|
|
list_extensions),
|
|
]
|
|
cs = fakes.FakeClient(extensions=extensions)
|
|
|
|
|
|
class ListExtensionsTests(utils.TestCase):
|
|
def test_list_extensions(self):
|
|
all_exts = cs.list_extensions.show_all()
|
|
cs.assert_called('GET', '/extensions')
|
|
self.assertTrue(len(all_exts) > 0)
|
|
for r in all_exts:
|
|
self.assertTrue(len(r.summary) > 0)
|