1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-28 00:39:31 +08:00

add regression test for #4823

for both online and offline mode (tests both the cli and the api)

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:
Steven Allen
2018-03-18 13:00:17 -07:00
parent 45fd7d213f
commit 4e9a6c7eab

View File

@ -90,4 +90,27 @@ test_expect_success "publish an explicit node ID as key name looks good" '
test_cmp expected_node_id_publish actual_node_id_publish
'
# test publishing nothing
test_expect_success "'ipfs name publish' fails" '
PEERID=`ipfs id --format="<id>"` &&
test_check_peerid "${PEERID}" &&
printf '' | test_expect_code 1 ipfs name publish >publish_out 2>&1
'
test_expect_success "publish output has the correct error" '
grep "argument \"ipfs-path\" is required" publish_out
'
test_launch_ipfs_daemon
test_expect_success "empty request to name publish doesn't panic and returns error" '
curl "http://$API_ADDR/api/v0/name/publish" > curl_out || true &&
grep "argument \"ipfs-path\" is required" curl_out
'
test_kill_ipfs_daemon
test_done