From fc12fe83562430bc406877583111ed725d08edc8 Mon Sep 17 00:00:00 2001 From: zhongjun Date: Thu, 21 Sep 2017 09:40:12 +0800 Subject: Add some unittest files such as test_nova.py 1.Add test_glance.py, test_neutron.py and test_nova.py unittest files, and modify the neutron.py to adapt the unittest. 2.Add some unittest functions in test_post_execute.py, test_deploy.py, test_keystoneauth.py. 3.rename test_prepare_execure.py to test_prepare_execute.py. Change-Id: Ie0640d133e27c558648416a6a5cf044a00ffa67f Signed-off-by: zhongjun --- tests/unit/post/test_keystoneauth.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/unit/post/test_keystoneauth.py') diff --git a/tests/unit/post/test_keystoneauth.py b/tests/unit/post/test_keystoneauth.py index 1ae86452..1a3021ee 100644 --- a/tests/unit/post/test_keystoneauth.py +++ b/tests/unit/post/test_keystoneauth.py @@ -102,3 +102,13 @@ def test__parse_openrc(openrc_conf_file_dir, openrc_file_name, expected): KeystoneClient = Keystoneauth(openrc) ret_openrc_dict = KeystoneClient._parse_openrc() assert expected == ret_openrc_dict + + +@pytest.mark.parametrize('openrc_file_name', [ + ( + 'admin-openrc.sh' + )]) +def test__get_auth(openrc_conf_file_dir, openrc_file_name,): + openrc = os.path.join(openrc_conf_file_dir, openrc_file_name) + KeystoneClient = Keystoneauth(openrc) + assert KeystoneClient._get_auth() -- cgit 1.2.3-korg