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 <[email protected]>
  • Loading branch information
te0d committed Jul 27, 2017
1 parent 0a01ffb commit 5b74496
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" '
curl -s -F file=@- "http://localhost:$API_PORT/api/v0/add" <<< "hi" | grep "\"Size\": *\"11\""
'
test_kill_ipfs_daemon

test_done

0 comments on commit 5b74496

Please sign in to comment.