Commit 6c02259a authored by Jeromy's avatar Jeromy

add a basic test for unwant

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>
parent c38ca003
#!/bin/sh
#
# Copyright (c) 2015 Jeromy Johnson
# MIT Licensed; see the LICENSE file in this repository.
#
test_description="test bitswap commands"
. lib/test-lib.sh
test_init_ipfs
test_launch_ipfs_daemon
test_expect_success "'ipfs block get' adds hash to wantlist" '
export NONEXIST=QmeXxaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&
test_expect_code 1 ipfs block get $NONEXIST --timeout=10ms &&
ipfs bitswap wantlist | grep $NONEXIST
'
test_expect_success "'ipfs bitswap unwant' succeeds" '
ipfs bitswap unwant $NONEXIST
'
test_expect_success "hash was removed from wantlist" '
ipfs bitswap wantlist > wantlist_out &&
printf "" > wantlist_exp &&
test_cmp wantlist_out wantlist_exp
'
test_kill_ipfs_daemon
test_done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment