Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8c2bc6f

Browse filesBrowse files
author
anonx
committed
Custom methods family get URIs instead of URNs now
1 parent c64f4e2 commit 8c2bc6f
Copy full SHA for 8c2bc6f

File tree

Expand file treeCollapse file tree

1 file changed

+17
-17
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+17
-17
lines changed

‎tests.go

Copy file name to clipboardExpand all lines: tests.go
+17-17Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ func (t *TestSuite) WebSocketUrl() string {
6565
// Issue a GET request to the given path and store the result in Request and
6666
// RequestBody.
6767
func (t *TestSuite) Get(path string) {
68-
t.GetCustom(path).Send()
68+
t.GetCustom(t.BaseUrl() + path).Send()
6969
}
7070

71-
// Return a GET request to the given path in a form of its wrapper.
72-
func (t *TestSuite) GetCustom(path string) *TestRequest {
73-
req, err := http.NewRequest("GET", t.BaseUrl()+path, nil)
71+
// Return a GET request to the given uri in a form of its wrapper.
72+
func (t *TestSuite) GetCustom(uri string) *TestRequest {
73+
req, err := http.NewRequest("GET", uri, nil)
7474
if err != nil {
7575
panic(err)
7676
}
@@ -83,12 +83,12 @@ func (t *TestSuite) GetCustom(path string) *TestRequest {
8383
// Issue a DELETE request to the given path and store the result in Request and
8484
// RequestBody.
8585
func (t *TestSuite) Delete(path string) {
86-
t.DeleteCustom(path).Send()
86+
t.DeleteCustom(t.BaseUrl() + path).Send()
8787
}
8888

89-
// Return a DELETE request to the given path in a form of its wrapper.
90-
func (t *TestSuite) DeleteCustom(path string) *TestRequest {
91-
req, err := http.NewRequest("DELETE", t.BaseUrl()+path, nil)
89+
// Return a DELETE request to the given uri in a form of its wrapper.
90+
func (t *TestSuite) DeleteCustom(uri string) *TestRequest {
91+
req, err := http.NewRequest("DELETE", uri, nil)
9292
if err != nil {
9393
panic(err)
9494
}
@@ -101,13 +101,13 @@ func (t *TestSuite) DeleteCustom(path string) *TestRequest {
101101
// Issue a POST request to the given path, sending the given Content-Type and
102102
// data, and store the result in Request and RequestBody. "data" may be nil.
103103
func (t *TestSuite) Post(path string, contentType string, reader io.Reader) {
104-
t.PostCustom(path, contentType, reader).Send()
104+
t.PostCustom(t.BaseUrl()+path, contentType, reader).Send()
105105
}
106106

107-
// Return a POST request to the given path with specified Content-Type and data
107+
// Return a POST request to the given uri with specified Content-Type and data
108108
// in a form of wrapper. "data" may be nil.
109-
func (t *TestSuite) PostCustom(path string, contentType string, reader io.Reader) *TestRequest {
110-
req, err := http.NewRequest("POST", t.BaseUrl()+path, reader)
109+
func (t *TestSuite) PostCustom(uri string, contentType string, reader io.Reader) *TestRequest {
110+
req, err := http.NewRequest("POST", uri, reader)
111111
if err != nil {
112112
panic(err)
113113
}
@@ -121,13 +121,13 @@ func (t *TestSuite) PostCustom(path string, contentType string, reader io.Reader
121121
// Issue a POST request to the given path as a form post of the given key and
122122
// values, and store the result in Request and RequestBody.
123123
func (t *TestSuite) PostForm(path string, data url.Values) {
124-
t.PostFormCustom(path, data).Send()
124+
t.PostFormCustom(t.BaseUrl()+path, data).Send()
125125
}
126126

127-
// Return a POST request to the given path as a form post of the given key and values.
128-
// The request is a wrapper of type TestRequest.
129-
func (t *TestSuite) PostFormCustom(path string, data url.Values) *TestRequest {
130-
return t.PostCustom(path, "application/x-www-form-urlencoded", strings.NewReader(data.Encode()))
127+
// Return a POST request to the given uri as a form post of the given key and values.
128+
// The request is in a form of TestRequest wrapper.
129+
func (t *TestSuite) PostFormCustom(uri string, data url.Values) *TestRequest {
130+
return t.PostCustom(uri, "application/x-www-form-urlencoded", strings.NewReader(data.Encode()))
131131
}
132132

133133
// Issue a multipart request for the method & fields given and read the response.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.