Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
de702ead
Commit
de702ead
authored
Dec 28, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add sharness test to verify requests look good
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
41b89d2f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
test/sharness/t0235-cli-request.sh
test/sharness/t0235-cli-request.sh
+33
-0
No files found.
test/sharness/t0235-cli-request.sh
0 → 100755
View file @
de702ead
#!/bin/sh
#
# Copyright (c) 2015 Jeromy Johnson
# MIT Licensed; see the LICENSE file in this repository.
#
test_description
=
"test http requests made by cli"
.
lib/test-lib.sh
test_init_ipfs
test_launch_ipfs_daemon
test_expect_success
"can make http request against nc server"
'
go-sleep 0.5s | nc -l 5005 > nc_out &
ipfs cat /ipfs/Qmabcdef --api /ip4/127.0.0.1/tcp/5005 || true
'
test_expect_success
"output does not contain multipart info"
'
test_expect_code 1 grep multipart nc_out
'
test_expect_success
"request looks good"
'
grep "POST /api/v0/cat" nc_out
'
test_expect_success
"api flag does not appear in request"
'
test_expect_code 1 grep "api=/ip4" nc_out
'
test_kill_ipfs_daemon
test_done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment