提交 4e9a6c7e 作者: Steven Allen

add regression test for #4823

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

License: MIT
Signed-off-by: 's avatarSteven Allen <steven@stebalien.com>
上级 45fd7d21
......@@ -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
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论