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 mock test for network operations on client side #1020

Merged
merged 1 commit into from
Apr 2, 2018
Merged

Conversation

ZouRui89
Copy link
Contributor

@ZouRui89 ZouRui89 commented Mar 30, 2018

Signed-off-by: Zou Rui 21751189@zju.edu.cn

Ⅰ. Describe what this PR did

add mock test for all the network operations on client side

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-io
Copy link

codecov-io commented Mar 30, 2018

Codecov Report

Merging #1020 into master will increase coverage by 0.36%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1020      +/-   ##
==========================================
+ Coverage   14.21%   14.58%   +0.36%     
==========================================
  Files         127      130       +3     
  Lines        8474     8481       +7     
==========================================
+ Hits         1205     1237      +32     
+ Misses       7169     7144      -25     
  Partials      100      100
Impacted Files Coverage Δ
client/network_create.go 100% <100%> (ø)
client/network_remove.go 100% <100%> (ø)
client/network_inspect.go 100% <100%> (ø)
client/network_list.go 100% <100%> (ø)
client/request.go 54.87% <0%> (+2.43%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c66c991...fc3083a. Read the comment docs.

return nil, err
}
return &http.Response{
StatusCode: http.StatusOK,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this API should return 201 StatusCreated, if it works with no error.

return nil, err
}

network := &types.NetworkListResp{}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I do not think the naming of network makes sense.

Maybe netListResp := &types.NetworkListResp{} is a little better.

}

return &http.Response{
StatusCode: http.StatusOK,
Copy link
Collaborator

Choose a reason for hiding this comment

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

StatusNoContent, rather than StatusOK.

Signed-off-by: Zou Rui <21751189@zju.edu.cn>
@ZouRui89 ZouRui89 changed the title test: add mock test for all the network operations on client side test: add mock test for network operations on client side Apr 2, 2018
@allencloud
Copy link
Collaborator

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Apr 2, 2018
@allencloud allencloud merged commit fa5eb85 into AliyunContainerService:master Apr 2, 2018
@ZouRui89 ZouRui89 deleted the mock_net branch April 2, 2018 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
areas/network areas/test LGTM one maintainer or community participant agrees to merge the pull reuqest. size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants