mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
client: s/assertResponse/assertRequest/
This commit is contained in:
parent
6e637f2f75
commit
84e495e51e
@ -120,7 +120,7 @@ func TestGetAction(t *testing.T) {
|
||||
wantURL := baseWantURL
|
||||
wantURL.RawQuery = tt.wantQuery
|
||||
|
||||
err := assertResponse(got, wantURL, wantHeader, nil)
|
||||
err := assertRequest(got, wantURL, wantHeader, nil)
|
||||
if err != nil {
|
||||
t.Errorf("#%d: %v", i, err)
|
||||
}
|
||||
@ -169,7 +169,7 @@ func TestWaitAction(t *testing.T) {
|
||||
wantURL := baseWantURL
|
||||
wantURL.RawQuery = tt.wantQuery
|
||||
|
||||
err := assertResponse(got, wantURL, wantHeader, nil)
|
||||
err := assertRequest(got, wantURL, wantHeader, nil)
|
||||
if err != nil {
|
||||
t.Errorf("#%d: %v", i, err)
|
||||
}
|
||||
@ -298,13 +298,13 @@ func TestSetAction(t *testing.T) {
|
||||
}
|
||||
|
||||
got := tt.act.HTTPRequest(url.URL{Scheme: "http", Host: "example.com"})
|
||||
if err := assertResponse(*got, u, wantHeader, []byte(tt.wantBody)); err != nil {
|
||||
if err := assertRequest(*got, u, wantHeader, []byte(tt.wantBody)); err != nil {
|
||||
t.Errorf("#%d: %v", i, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func assertResponse(got http.Request, wantURL *url.URL, wantHeader http.Header, wantBody []byte) error {
|
||||
func assertRequest(got http.Request, wantURL *url.URL, wantHeader http.Header, wantBody []byte) error {
|
||||
if !reflect.DeepEqual(wantURL, got.URL) {
|
||||
return fmt.Errorf("want.URL=%#v got.URL=%#v", wantURL, got.URL)
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ func TestMembersAPIActionList(t *testing.T) {
|
||||
}
|
||||
|
||||
got := *act.HTTPRequest(ep)
|
||||
err := assertResponse(got, wantURL, http.Header{}, nil)
|
||||
err := assertRequest(got, wantURL, http.Header{}, nil)
|
||||
if err != nil {
|
||||
t.Error(err.Error())
|
||||
}
|
||||
@ -60,7 +60,7 @@ func TestMembersAPIActionAdd(t *testing.T) {
|
||||
wantBody := []byte(`{"peerURLs":["https://127.0.0.1:8081","http://127.0.0.1:8080"]}`)
|
||||
|
||||
got := *act.HTTPRequest(ep)
|
||||
err := assertResponse(got, wantURL, wantHeader, wantBody)
|
||||
err := assertRequest(got, wantURL, wantHeader, wantBody)
|
||||
if err != nil {
|
||||
t.Error(err.Error())
|
||||
}
|
||||
@ -77,7 +77,7 @@ func TestMembersAPIActionRemove(t *testing.T) {
|
||||
}
|
||||
|
||||
got := *act.HTTPRequest(ep)
|
||||
err := assertResponse(got, wantURL, http.Header{}, nil)
|
||||
err := assertRequest(got, wantURL, http.Header{}, nil)
|
||||
if err != nil {
|
||||
t.Error(err.Error())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user