diff options
author | 2017-09-14 19:30:05 +0800 | |
---|---|---|
committer | 2017-09-18 15:48:50 +0800 | |
commit | 42f3692a33504ed715eab9b1bef77e1737b1bfed (patch) | |
tree | d1fc60dac29f1accef5a0adc88863d309317d87d /tests/unit/post | |
parent | 81f5a26699ced0d7f254d05705e8c028471e44d1 (diff) |
Add the pytest file test_environment.py
1.Add the pytest file test_enviroment.py
2.Add the pytest file test_daisy_server.py
Change-Id: If679c3a7279a915d078dd3008bcfc56be6dccc3e
Signed-off-by: zhongjun <zhong.jun@zte.com.cn>
Diffstat (limited to 'tests/unit/post')
-rw-r--r-- | tests/unit/post/test_keystoneauth.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/unit/post/test_keystoneauth.py b/tests/unit/post/test_keystoneauth.py index afd9062a..1ae86452 100644 --- a/tests/unit/post/test_keystoneauth.py +++ b/tests/unit/post/test_keystoneauth.py @@ -80,3 +80,25 @@ def test_session(openrc_conf_file_dir): openrc = os.path.join(openrc_conf_file_dir, 'admin-openrc.sh') KeystoneClient = Keystoneauth(openrc) assert KeystoneClient.session + + +@pytest.mark.parametrize('openrc_file_name, expected', [ + ( + 'admin-openrc.sh', + { + 'OS_PROJECT_DOMAIN_NAME': 'Default', + 'OS_USER_DOMAIN_NAME': 'Default', + 'OS_PROJECT_NAME': 'admin', + 'OS_TENANT_NAME': 'admin', + 'OS_USERNAME': 'admin', + 'OS_PASSWORD': 'keystone', + 'OS_AUTH_URL': 'http://10.20.11.11:35357/v3', + 'OS_INTERFACE': 'internal', + 'OS_IDENTITY_API_VERSION': '3' + } + )]) +def test__parse_openrc(openrc_conf_file_dir, openrc_file_name, expected): + openrc = os.path.join(openrc_conf_file_dir, openrc_file_name) + KeystoneClient = Keystoneauth(openrc) + ret_openrc_dict = KeystoneClient._parse_openrc() + assert expected == ret_openrc_dict |