1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-25 06:58:18 +08:00

correctly test refs local

We expect it to return a command error, not a 404, because `local` will be
interpreted as a path.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:
Steven Allen
2017-12-15 11:07:32 -08:00
parent cccd03e875
commit 6bd524fa3a

View File

@ -153,7 +153,6 @@ for cmd in add \
object/patch \
pin \
ping \
refs/local \
repo \
stats \
swarm \
@ -166,6 +165,13 @@ do
'
done
# This one is different. `local` will be interpreted as a path if the command isn't defined.
test_expect_success "test gateway api is sanitized: refs/local" '
echo "Error: invalid '"'ipfs ref'"' path" > refs_local_expected &&
! ipfs --api /ip4/127.0.0.1/tcp/$port refs local > refs_local_actual 2>&1 &&
test_cmp refs_local_expected refs_local_actual
'
test_expect_success "create raw-leaves node" '
echo "This is RAW!" > rfile &&
echo "This is RAW!" | ipfs add --raw-leaves -q > rhash