Multiple API version support

* Use multiple entry point groups to represent each API+version
  combination supported
* Add some tests

Try it out:
* Right now only '* user' commands have multiple overlapping versions;
  you can see the selection between v2.0 and v3 by looking at the
  command help output for 'tenant' vs 'project':

  os --os-identity-api-version=2.0 help set user
  os --os-identity-api-version=3 help set user

Change-Id: I7114fd246843df0243d354a7cce697810bb7de62
This commit is contained in:
Dean Troyer
2013-01-31 19:30:25 -06:00
parent b26cb5bf68
commit fbc412e533
10 changed files with 540 additions and 27 deletions

@ -108,6 +108,30 @@ class TestShell(utils.TestCase):
default_args["image_api_version"])
class TestShellHelp(TestShell):
"""Test the deferred help flag"""
def setUp(self):
super(TestShellHelp, self).setUp()
self.orig_env, os.environ = os.environ, {}
def tearDown(self):
super(TestShellHelp, self).tearDown()
os.environ = self.orig_env
def test_help_options(self):
flag = "-h list server"
kwargs = {
"deferred_help": True,
}
with mock.patch("openstackclient.shell.OpenStackShell.initialize_app",
self.app):
_shell, _cmd = make_shell(), flag
fake_execute(_shell, _cmd)
self.assertEqual(_shell.options.deferred_help,
kwargs["deferred_help"])
class TestShellPasswordAuth(TestShell):
def setUp(self):
super(TestShellPasswordAuth, self).setUp()