Skip to content

Instantly share code, notes, and snippets.

@te0d
Last active July 25, 2017 22:38
Show Gist options
  • Save te0d/fcdfc0d1578fc3bcb7d1fed36c2a260b to your computer and use it in GitHub Desktop.
Save te0d/fcdfc0d1578fc3bcb7d1fed36c2a260b to your computer and use it in GitHub Desktop.
ipfs API add response test case draft
#!/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\":
'
test_kill_ipfs_daemon
test_done
@Kubuxu
Copy link

Kubuxu commented Jul 25, 2017

If you do this, use echo hi instead of <<<. It is bash only notation AFAIK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment