(t *testing.T, c *Client)
| 763 | } |
| 764 | |
| 765 | func testForm(t *testing.T, c *Client) { |
| 766 | var userInfo UserInfo |
| 767 | resp, err := c.R(). |
| 768 | SetFormData(map[string]string{ |
| 769 | "username": "imroc", |
| 770 | "type": "xml", |
| 771 | }). |
| 772 | SetSuccessResult(&userInfo). |
| 773 | Post("/search") |
| 774 | assertSuccess(t, resp, err) |
| 775 | tests.AssertEqual(t, "roc@imroc.cc", userInfo.Email) |
| 776 | |
| 777 | v := make(url.Values) |
| 778 | v.Add("username", "imroc") |
| 779 | v.Add("type", "xml") |
| 780 | resp, err = c.R(). |
| 781 | SetFormDataFromValues(v). |
| 782 | SetSuccessResult(&userInfo). |
| 783 | Post("/search") |
| 784 | assertSuccess(t, resp, err) |
| 785 | tests.AssertEqual(t, "roc@imroc.cc", userInfo.Email) |
| 786 | } |
| 787 | |
| 788 | func TestHostHeaderOverride(t *testing.T) { |
| 789 | testWithAllTransport(t, testHostHeaderOverride) |
nothing calls this directly
no test coverage detected
searching dependent graphs…