提交 c0a04a06 作者: Michael Muré

add sharness test for ipfs key rename

License: MIT
Signed-off-by: 's avatarMichael Muré <batolettre@gmail.com>
上级 3aa6d78e
......@@ -44,6 +44,24 @@ test_key_cmd() {
ipfs key list | sort > list_out &&
test_cmp list_exp list_out
'
test_expect_success "key rename rename a key" '
ipfs key rename bazed fooed
echo fooed > list_exp &&
echo self >> list_exp
ipfs key list | sort > list_out &&
test_cmp list_exp list_out
'
test_expect_success "key rename can't remove self" '
test_must_fail ipfs key rename self bar 2>&1 | tee key_rename_out &&
grep -q "Error: cannot rename key with name" key_rename_out
'
test_expect_success "key rename can't overwrite self, even with force" '
test_must_fail ipfs key rename -f fooed self 2>&1 | tee key_rename_out &&
grep -q "Error: cannot overwrite key with name" key_rename_out
'
}
test_key_cmd
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论