Skip to content

Commit 5b74496

Browse files
committed
ipfs add: added test case to verify presence of size
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]>
1 parent 0a01ffb commit 5b74496

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/sharness/t0410-api-add.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (c) 2016 Tom O'Donnell
4+
# MIT Licensed; see the LICENSE file in this repository.
5+
#
6+
7+
test_description="Test API add command"
8+
9+
. lib/test-lib.sh
10+
11+
test_init_ipfs
12+
13+
# Verify that that API add command returns size
14+
15+
test_launch_ipfs_daemon
16+
test_expect_success "API Add response includes size field" '
17+
curl -s -F file=@- "http://localhost:$API_PORT/api/v0/add" <<< "hi" | grep "\"Size\": *\"11\""
18+
'
19+
test_kill_ipfs_daemon
20+
21+
test_done

0 commit comments

Comments
 (0)