Skip to content

Commit

Permalink
cmds/pin: modify test
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Overbool <[email protected]>
  • Loading branch information
overbool committed Dec 15, 2018
1 parent 3952644 commit 31712ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
9 changes: 1 addition & 8 deletions core/commands/pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var PinCmd = &cmds.Command{

type PinOutput struct {
Pins []string
Error string
Error string `json:",omitempty"`
}

// PinUpdateOutput represents the pin update output
Expand Down Expand Up @@ -74,18 +74,11 @@ var addPinCmd = &cmds.Command{
},
Type: AddPinOutput{},
Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error {
n, err := cmdenv.GetNode(env)
if err != nil {
return err
}

api, err := cmdenv.GetApi(env)
if err != nil {
return err
}

defer n.Blockstore.PinLock().Unlock()

// set recursive flag
recursive, _ := req.Options[pinRecursiveOptionName].(bool)
showProgress, _ := req.Options[pinProgressOptionName].(bool)
Expand Down
3 changes: 2 additions & 1 deletion test/sharness/t0080-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ test_expect_success "pinning directly should fail now" '
'

test_expect_success "'ipfs pin rm -r=false <hash>' should fail" '
echo "Error: $HASH is pinned recursively" >expected4 &&
echo "cannot unpin $HASH: $HASH is pinned recursively" >expected4 &&
echo "Error: some hash not unpinned" >>expected4 &&
test_must_fail ipfs pin rm -r=false "$HASH" 2>actual4 &&
test_cmp expected4 actual4
'
Expand Down

0 comments on commit 31712ff

Please sign in to comment.