diff options
author | Gregory Haynes <greg@greghaynes.net> | 2015-09-16 17:22:39 -0700 |
---|---|---|
committer | Gregory Haynes <greg@greghaynes.net> | 2015-09-16 17:51:29 -0700 |
commit | 0339a9a7f8c004b7e6df5c3d9dc49a69fcc3b357 (patch) | |
tree | 74ae9e9c3bc3dddc4d0adc2cc999d278ae19f724 /os_client_config/tests/test_config.py | |
parent | 4287c75c5795665e2a7dfdbab826adbc1a106df4 (diff) | |
download | os-client-config-0339a9a7f8c004b7e6df5c3d9dc49a69fcc3b357.tar.gz |
Convert auth kwargs '-' to '_'
When passing in kwargs to _get_one_cloud we do not dive into the auth
dict to convert '-' to '_'.
Change-Id: I8ce12370b5fd4444ba17d724e7f8036a7b0d2784
Diffstat (limited to 'os_client_config/tests/test_config.py')
-rw-r--r-- | os_client_config/tests/test_config.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/os_client_config/tests/test_config.py b/os_client_config/tests/test_config.py index 36fe15d..9c9451d 100644 --- a/os_client_config/tests/test_config.py +++ b/os_client_config/tests/test_config.py @@ -106,6 +106,21 @@ class TestConfig(base.TestCase): cc = c.get_one_cloud('_test_cloud_hyphenated') self.assertEqual('12345', cc.auth['project_id']) + def test_get_one_cloud_with_hyphenated_kwargs(self): + c = config.OpenStackConfig(config_files=[self.cloud_yaml], + vendor_files=[self.vendor_yaml]) + args = { + 'auth': { + 'username': 'testuser', + 'password': 'testpass', + 'project-id': '12345', + 'auth-url': 'http://example.com/v2', + }, + 'region_name': 'test-region', + } + cc = c.get_one_cloud(**args) + self.assertEqual('http://example.com/v2', cc.auth['auth_url']) + def test_no_environ(self): c = config.OpenStackConfig(config_files=[self.cloud_yaml], vendor_files=[self.vendor_yaml]) |