Merge pull request #34600 from dnephin/remove-pkg-testutil

Remove pkg/testutil/utils.go
Upstream-commit: 59e1565565071da160a0ad3781335e4f974f93f8
Component: engine
This commit is contained in:
Victor Vieux
2017-08-23 09:38:20 -07:00
committed by GitHub
28 changed files with 355 additions and 732 deletions
@@ -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)
}