-
Notifications
You must be signed in to change notification settings - Fork 950
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
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
client/network_create_test.go
Outdated
return nil, err | ||
} | ||
return &http.Response{ | ||
StatusCode: http.StatusOK, |
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 think this API should return 201 StatusCreated, if it works with no error.
return nil, err | ||
} | ||
|
||
network := &types.NetworkListResp{} |
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 do not think the naming of network makes sense.
Maybe netListResp := &types.NetworkListResp{}
is a little better.
client/network_remove_test.go
Outdated
} | ||
|
||
return &http.Response{ | ||
StatusCode: http.StatusOK, |
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.
StatusNoContent, rather than StatusOK.
Signed-off-by: Zou Rui <21751189@zju.edu.cn>
LGTM |
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