Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 2469c82

Browse files
committed
Add pin.go unit test
1 parent 318663d commit 2469c82

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

ipfs/pin_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package ipfs
2+
3+
import (
4+
"path"
5+
"testing"
6+
)
7+
8+
func TestUnPinDir(t *testing.T) {
9+
ctx, err := MockCmdsCtx()
10+
if err != nil {
11+
t.Error(err)
12+
}
13+
root, err := AddDirectory(ctx, path.Join("./", "root"))
14+
if err != nil {
15+
t.Error(err)
16+
}
17+
err = UnPinDir(ctx, root)
18+
if err != nil {
19+
t.Error(err)
20+
}
21+
err = UnPinDir(ctx, "fasdfasdf")
22+
if err == nil {
23+
t.Error("Should have through error unpinning known directory")
24+
}
25+
}

0 commit comments

Comments
 (0)