Skip to content

Commit

Permalink
ipfs add: added test case to verify presence of size
Browse files Browse the repository at this point in the history
Added test case which greps the `ipfs add` api call,
checking that it outputs the added item's size.

License: MIT
Signed-off-by: Tom O'Donnell <todonnell91@gmail.com>
  • Loading branch information
te0d committed Jul 27, 2017
1 parent 0a01ffb commit f96f6af
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/sharness/t0410-api-add.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
#
# Copyright (c) 2016 Tom O'Donnell
# MIT Licensed; see the LICENSE file in this repository.
#

test_description="Test API add command"

. lib/test-lib.sh

test_init_ipfs

# Verify that that API add command returns size

test_launch_ipfs_daemon
test_expect_success "API Add response includes size field" '
echo "hi" | curl -s -F file=@- "http://localhost:$API_PORT/api/v0/add" | grep "\"Size\": *\"11\""
'
test_kill_ipfs_daemon

test_done

0 comments on commit f96f6af

Please sign in to comment.