-
Notifications
You must be signed in to change notification settings - Fork 949
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 unit-test for Volume Core's DetachVolume method #1824
test: Add unit-test for Volume Core's DetachVolume method #1824
Conversation
We found this is your first time to contribute to Pouch, @panzaiyu |
storage/volume/core_test.go
Outdated
@@ -228,6 +228,54 @@ func TestAttachVolume(t *testing.T) { | |||
// TODO | |||
} | |||
|
|||
//Mock data for TestDetachVolume | |||
func mockVolumeCore(root string) (*Core, error) { |
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 function is ok, but we already has a function to NewCore: createVolumeCore
Codecov Report
@@ Coverage Diff @@
## master #1824 +/- ##
==========================================
+ Coverage 56.3% 56.38% +0.07%
==========================================
Files 200 200
Lines 15657 15659 +2
==========================================
+ Hits 8816 8829 +13
+ Misses 5745 5738 -7
+ Partials 1096 1092 -4
|
storage/volume/core_test.go
Outdated
|
||
//create volume core | ||
|
||
core, err := mockVolumeCore(dir) |
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 createVolumeCore
@panzaiyu please update the code as comment, thanks a lot. |
@panzaiyu Thanks for your contribution. 🍻 |
lgtm |
Ⅰ. Describe what this PR did
Add unit-test for Volume Core's DetachVolume method
Ⅱ. Does this pull request fix one issue?
fixes #1761
Ⅲ. Describe how you did it
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews