New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test:add-test-model #761
test:add-test-model #761
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Please ignore unnecessary files, for example |
rm -rf cycloneclient | ||
mkdir cycloneclient | ||
java -jar swagger-codegen-cli.jar generate -i api.v1alpha1.json -l python -o cycloneclient | ||
cd cycloneclient; python3 ./setup.py install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you generate the client with docker container, so that we don't have to depend on java
and python3
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This client only has code, and does not need to be run. so it is just a package of python.
I do not think the docker container is the appropriate solution.
import swagger_client | ||
from swagger_client.rest import ApiException | ||
|
||
def is_member_exist_in_project(members, member_user_name, expected_member_role_id = None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove unrelated codes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@unittest.skipIf(TEARDOWN == False, "Test data won't be erased.") | ||
def test_ClearData(self): | ||
#1. Delete repository(RA) by admin; | ||
kk = {"x_tenant":"devops"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use meaningful var name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
USER_ROLE=dict(admin=0,normal=1) | ||
TEARDOWN = True | ||
|
||
def GetProductApi(username, password, harbor_server= "192.168.17.100:30022"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is 'product' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget to change the name.
/hold |
What this PR does / why we need it:
add swagger-client test framework
Which issue(s) this PR is related to (optional, link to 3rd issue(s)):
Fixes #
Reference to #
Special notes for your reviewer:
/cc @cd1989 @zhujian7
Release note: