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 <todonnell91@gmail.com>
Tom O'Donnell (te0d) committed
Jul 26, 2017 at 13:54 UTC
f96f6af98f5415cc9fc639a534c30cd81c2c6e83
1 file changed
+21
test/sharness/t0410-api-add.sh
new
+21
@@ -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
+ echo "hi" | curl -s -F file=@- "http://localhost:$API_PORT/api/v0/add" | grep "\"Size\": *\"11\""
18
+'
19
+test_kill_ipfs_daemon
20
+
21
+test_done