Skip to content

Commit

Permalink
add more tests for runtime/http
Browse files Browse the repository at this point in the history
  • Loading branch information
verdverm committed Jun 23, 2020
1 parent 5fd5941 commit 9ac5c54
Showing 3 changed files with 30 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/mod/testdata/unimplemented_commands.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### Unimplemented commands

! hof mod convert cue dummy

! hof mod tidy cue
! hof mod graph cue
2 changes: 1 addition & 1 deletion script/runtime/cmd_http.go
Original file line number Diff line number Diff line change
@@ -231,7 +231,7 @@ func (ts *Script) applyArgToReq(req *gorequest.SuperAgent, arg string) (*goreque
req = req.Set(k, v)

case "M", "METHOD":
req.Method = K
req.Method = val
// Specially recognized key only args
case "GET", "POST", "HEAD", "PUT", "DELETE", "PATCH", "OPTIONS":
req.Method = K
23 changes: 23 additions & 0 deletions script/runtime/tests/http.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
### Test a basic http call

http https://postman-echo.com/get?cow=moo
status 200

http GET https://postman-echo.com/get?cow=moo
status 200

http GET https://postman-echo.com/get?cow=moo H='my-header: my-value'
status 200

http GET https://postman-echo.com/get?cow=moo A='my-header: my-value'
status 200

http https://postman-echo.com/get?cow=moo M=GET A='my-header: my-value'
status 200

http POST https://postman-echo.com/post D='{ "foo": "bar" }'
status 200

http POST https://postman-echo.com/post D='{ "foo": "bar" }' R='3 3s 500'
status 200

0 comments on commit 9ac5c54

Please sign in to comment.