diff options
| author | Zuul <zuul@review.openstack.org> | 2017-10-19 02:12:06 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2017-10-19 02:12:06 +0000 |
| commit | a8364340dd21133831b5f13754bb4a1f7debd4e5 (patch) | |
| tree | a65e32f4a56109757ed56a2b7e4938dc55d31548 /cinderclient/tests | |
| parent | f6f5a706ba1f2ee38bd066d9313f88735cde121c (diff) | |
| parent | ce1013d6b3b19baf81e393febe8a708cbe747f7b (diff) | |
| download | python-cinderclient-a8364340dd21133831b5f13754bb4a1f7debd4e5.tar.gz | |
Merge "Fix OS_AUTH_TYPE env var usage"
Diffstat (limited to 'cinderclient/tests')
| -rw-r--r-- | cinderclient/tests/unit/test_shell.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cinderclient/tests/unit/test_shell.py b/cinderclient/tests/unit/test_shell.py index 728dfd4..9930f58 100644 --- a/cinderclient/tests/unit/test_shell.py +++ b/cinderclient/tests/unit/test_shell.py @@ -72,6 +72,26 @@ class ShellTest(utils.TestCase): return out + def test_default_auth_env(self): + _shell = shell.OpenStackCinderShell() + args, __ = _shell.get_base_parser().parse_known_args([]) + self.assertEqual('', args.os_auth_type) + + def test_auth_type_env(self): + self.make_env(exclude='OS_PASSWORD', + include={'OS_AUTH_SYSTEM': 'non existent auth', + 'OS_AUTH_TYPE': 'noauth'}) + _shell = shell.OpenStackCinderShell() + args, __ = _shell.get_base_parser().parse_known_args([]) + self.assertEqual('noauth', args.os_auth_type) + + def test_auth_system_env(self): + self.make_env(exclude='OS_PASSWORD', + include={'OS_AUTH_SYSTEM': 'noauth'}) + _shell = shell.OpenStackCinderShell() + args, __ = _shell.get_base_parser().parse_known_args([]) + self.assertEqual('noauth', args.os_auth_type) + def test_help_unknown_command(self): self.assertRaises(exceptions.CommandError, self.shell, 'help foofoo') |
