Merge pull request #34600 from dnephin/remove-pkg-testutil
Remove pkg/testutil/utils.go Upstream-commit: 59e1565565071da160a0ad3781335e4f974f93f8 Component: engine
This commit is contained in:
@@ -253,7 +253,7 @@ func TestGetWithStatusError(t *testing.T) {
|
||||
if testcase.expectedErr == "" {
|
||||
require.NoError(t, err)
|
||||
|
||||
body, err := testutil.ReadBody(response.Body)
|
||||
body, err := readBody(response.Body)
|
||||
require.NoError(t, err)
|
||||
assert.Contains(t, string(body), testcase.expectedBody)
|
||||
} else {
|
||||
@@ -261,3 +261,8 @@ func TestGetWithStatusError(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func readBody(b io.ReadCloser) ([]byte, error) {
|
||||
defer b.Close()
|
||||
return ioutil.ReadAll(b)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user