Skip to content
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

Closed
wants to merge 1 commit into from
Closed

test:add-test-model #761

wants to merge 1 commit into from

Conversation

caicaihe
Copy link

@caicaihe caicaihe commented Jan 28, 2019

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:

NONE

@caicloud-bot caicloud-bot added release-note-none Denotes a PR that doesn't merit a release note. caicloud-cla: yes Indicates the PR's author has not signed the Caicloud CLA. labels Jan 28, 2019
@caicloud-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: supereagle

Assign the PR to them by writing /assign @supereagle in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@caicloud-bot caicloud-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 28, 2019
@caicaihe caicaihe changed the title caicaihe:add-test-model add-test-model Jan 28, 2019
@caicaihe caicaihe changed the title add-test-model test:add-test-model Jan 28, 2019
@cd1989
Copy link
Contributor

cd1989 commented Jan 28, 2019

Please ignore unnecessary files, for example *.pyc by editing .gitignore @caicaihe

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
Copy link
Contributor

@cd1989 cd1989 Jan 28, 2019

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 ?

Copy link
Author

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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove unrelated codes.

Copy link
Author

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"}
Copy link
Contributor

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

Copy link
Author

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"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is 'product' ?

Copy link
Author

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.

@cd1989
Copy link
Contributor

cd1989 commented Jan 28, 2019

/hold

@caicloud-bot caicloud-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 28, 2019
@caicaihe caicaihe closed this Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
caicloud-cla: yes Indicates the PR's author has not signed the Caicloud CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants