Skip to content

Commit

Permalink
remove unused fakeUpgradeConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Ojea committed Nov 17, 2021
1 parent 9336ff7 commit bf9ce7f
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions staging/src/k8s.io/client-go/rest/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import (
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/runtime/serializer/streaming"
"k8s.io/apimachinery/pkg/util/diff"
"k8s.io/apimachinery/pkg/util/httpstream"
"k8s.io/apimachinery/pkg/util/intstr"
utilnet "k8s.io/apimachinery/pkg/util/net"
"k8s.io/apimachinery/pkg/watch"
Expand Down Expand Up @@ -1436,51 +1435,6 @@ func TestRequestStream(t *testing.T) {
}
}

//nolint:unused
type fakeUpgradeConnection struct{}

//nolint:unused
func (c *fakeUpgradeConnection) CreateStream(headers http.Header) (httpstream.Stream, error) {
return nil, nil
}

//nolint:unused
func (c *fakeUpgradeConnection) Close() error {
return nil
}

//nolint:unused
func (c *fakeUpgradeConnection) CloseChan() <-chan bool {
return make(chan bool)
}

//nolint:unused
func (c *fakeUpgradeConnection) SetIdleTimeout(timeout time.Duration) {
}

//nolint:unused
type fakeUpgradeRoundTripper struct {
req *http.Request
conn httpstream.Connection
}

//nolint:unused
func (f *fakeUpgradeRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
f.req = req
b := []byte{}
body := ioutil.NopCloser(bytes.NewReader(b))
resp := &http.Response{
StatusCode: http.StatusSwitchingProtocols,
Body: body,
}
return resp, nil
}

//nolint:unused
func (f *fakeUpgradeRoundTripper) NewConnection(resp *http.Response) (httpstream.Connection, error) {
return f.conn, nil
}

func TestRequestDo(t *testing.T) {
testCases := []struct {
Request *Request
Expand Down

0 comments on commit bf9ce7f

Please sign in to comment.