diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-01-13 20:21:57 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-01-13 20:21:57 +0000 |
commit | 94ea0644e56dae7c8150e901f2a4a13c31dbd8a0 (patch) | |
tree | abd36e9eaf7c18bb6eb5bc7596a63443d0f16bce /os_client_config/tests | |
parent | 14a3104ecad12f06415d5e6c72bf55d270cf3e66 (diff) | |
parent | a8532f6c8d221628b697ddb0d134e2a000ef61d6 (diff) | |
download | os-client-config-94ea0644e56dae7c8150e901f2a4a13c31dbd8a0.tar.gz |
Merge "Fix a precedence problem with auth arguments"
Diffstat (limited to 'os_client_config/tests')
-rw-r--r-- | os_client_config/tests/test_config.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/os_client_config/tests/test_config.py b/os_client_config/tests/test_config.py index dce436a..1a16bd8 100644 --- a/os_client_config/tests/test_config.py +++ b/os_client_config/tests/test_config.py @@ -473,6 +473,16 @@ class TestConfigArgparse(base.TestCase): opts, _remain = parser.parse_known_args(['--os-cloud', 'foo']) self.assertEqual(opts.os_cloud, 'foo') + def test_env_argparse_precedence(self): + self.useFixture(fixtures.EnvironmentVariable( + 'OS_TENANT_NAME', 'tenants-are-bad')) + c = config.OpenStackConfig(config_files=[self.cloud_yaml], + vendor_files=[self.vendor_yaml]) + + cc = c.get_one_cloud( + cloud='envvars', argparse=self.options) + self.assertEqual(cc.auth['project_name'], 'project') + def test_argparse_default_no_token(self): c = config.OpenStackConfig(config_files=[self.cloud_yaml], vendor_files=[self.vendor_yaml]) |