From 628927511838f639350080e3f9cc5604d9353013 Mon Sep 17 00:00:00 2001 From: danfengliu Date: Mon, 12 Nov 2018 23:39:16 +0800 Subject: [PATCH] Modify script call create project (#6263) Signed-off-by: danfengliu --- .../apitests/python/test_add_member_to_private_project.py | 2 +- tests/apitests/python/test_add_replication_rule.py | 4 ++-- tests/apitests/python/test_add_sys_label_to_tag.py | 8 ++++---- tests/apitests/python/test_del_repo.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/apitests/python/test_add_member_to_private_project.py b/tests/apitests/python/test_add_member_to_private_project.py index eea1b57c8..6e0c01158 100644 --- a/tests/apitests/python/test_add_member_to_private_project.py +++ b/tests/apitests/python/test_add_member_to_private_project.py @@ -44,7 +44,7 @@ class TestProjects(unittest.TestCase): USER_001_CLIENT=dict(endpoint = url, username = user_001_name, password = user_001_password) #2. Create private project-001 - project_001_name, project_001_id = self.project.create_project(metadata = {"public": "false"}, **ADMIN_CLIENT) + project_001_id, project_001_name = self.project.create_project(metadata = {"public": "false"}, **ADMIN_CLIENT) self.assertNotEqual(project_001_name, None, msg="Project was created failed, return project name is {} and id is {}.".format(project_001_name, project_001_id)) #3.1 Get private projects of user-001 diff --git a/tests/apitests/python/test_add_replication_rule.py b/tests/apitests/python/test_add_replication_rule.py index 06fab34a8..cf0b97044 100644 --- a/tests/apitests/python/test_add_replication_rule.py +++ b/tests/apitests/python/test_add_replication_rule.py @@ -46,7 +46,7 @@ class TestProjects(unittest.TestCase): def testAddSysLabelToRepo(self): """ Test case: - Delete a repository + Add Replication Rule Test step & Expectation: 1. Create a new user(UA); 2. Create a new private project(PA) by user(UA); @@ -71,7 +71,7 @@ class TestProjects(unittest.TestCase): TestProjects.USER_add_rule_CLIENT=dict(endpoint = url, username = user_add_rule_name, password = user_add_rule_password) #2.1. Create private project(PA) by user(UA) - _, TestProjects.project_add_rule_id = self.project.create_project(metadata = {"public": "false"}, **TestProjects.USER_add_rule_CLIENT) + TestProjects.project_add_rule_id, _ = self.project.create_project(metadata = {"public": "false"}, **TestProjects.USER_add_rule_CLIENT) #2.2. Get private project of uesr-001, uesr-001 can see only one private project which is project-001 self.project.projects_should_exist(dict(public=False), expected_count = 1, diff --git a/tests/apitests/python/test_add_sys_label_to_tag.py b/tests/apitests/python/test_add_sys_label_to_tag.py index e35eef7a4..7d09ab35e 100644 --- a/tests/apitests/python/test_add_sys_label_to_tag.py +++ b/tests/apitests/python/test_add_sys_label_to_tag.py @@ -46,12 +46,12 @@ class TestProjects(unittest.TestCase): def testAddSysLabelToRepo(self): """ Test case: - Delete a repository + Add Global Label To Tag Test step & Expectation: 1. Create a new user(UA); 2. Create a new private project(PA) by user(UA); 3. Add user(UA) as a member of project(PA) with project-admin role; - 4. Get private project of uesr-001, uesr-001 can see only one private project which is project-001; + 4. Get private project of user(UA), user(UA) can see only one private project which is project(PA); 5. Create a new repository(RA) and tag(TA) in project(PA) by user(UA); 6. Create a new label(LA) in project(PA) by admin;; 7. Add this system global label to repository(RA)/tag(TA); @@ -73,12 +73,12 @@ class TestProjects(unittest.TestCase): TestProjects.USER_add_g_lbl_CLIENT=dict(endpoint = url, username = user_add_g_lbl_name, password = user_001_password) #2. Create private project-001 - project_add_g_lbl_name, TestProjects.project_add_g_lbl_id = self.project.create_project(metadata = {"public": "false"}, **TestProjects.ADMIN_CLIENT) + TestProjects.project_add_g_lbl_id, project_add_g_lbl_name = self.project.create_project(metadata = {"public": "false"}, **TestProjects.ADMIN_CLIENT) #3. Add user-001 as a member of project-001 with project-admin role self.project.add_project_members(TestProjects.project_add_g_lbl_id, TestProjects.user_add_g_lbl_id, **TestProjects.ADMIN_CLIENT) - #4. Get private project of uesr-001, uesr-001 can see only one private project which is project-001 + #4. Get private project of user(UA), user(UA) can see only one private project which is project(PA); self.project.projects_should_exist(dict(public=False), expected_count = 1, expected_project_id = TestProjects.project_add_g_lbl_id, **TestProjects.USER_add_g_lbl_CLIENT) diff --git a/tests/apitests/python/test_del_repo.py b/tests/apitests/python/test_del_repo.py index 6e2696a63..6737468d2 100644 --- a/tests/apitests/python/test_del_repo.py +++ b/tests/apitests/python/test_del_repo.py @@ -65,7 +65,7 @@ class TestProjects(unittest.TestCase): TestProjects.USER_del_repo_CLIENT=dict(endpoint = url, username = user_del_repo_name, password = user_del_repo_password) #2. Create a new project(PA) by user(UA); - project_del_repo_name, TestProjects.project_del_repo_id = self.project.create_project(metadata = {"public": "false"}, **TestProjects.USER_del_repo_CLIENT) + TestProjects.project_del_repo_id, project_del_repo_name = self.project.create_project(metadata = {"public": "false"}, **TestProjects.USER_del_repo_CLIENT) #3. Create a new repository(RA) in project(PA) by user(UA); repo_name, _ = create_repository(project_del_repo_name, harbor_server, 'admin', 'Harbor12345', "hello-world", "latest")