From 42f3692a33504ed715eab9b1bef77e1737b1bfed Mon Sep 17 00:00:00 2001 From: zhongjun Date: Thu, 14 Sep 2017 19:30:05 +0800 Subject: 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 --- tests/unit/post/test_keystoneauth.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests/unit/post') 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 -- cgit