Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-09 15:08:25 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-09 15:08:25 +0300
commit48d25238c386a89e8a6af218eeb290936a8f7595 (patch)
tree68943880d54468655d103dd6ef0aafbba246c532 /workhorse/upload_test.go
parent5f2a8d5813e1123f06fa7b43d404ea524d9215fc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'workhorse/upload_test.go')
-rw-r--r--workhorse/upload_test.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/workhorse/upload_test.go b/workhorse/upload_test.go
index 5a08e80798a..dedda4ea655 100644
--- a/workhorse/upload_test.go
+++ b/workhorse/upload_test.go
@@ -4,7 +4,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"mime/multipart"
"net/http"
"net/http/httptest"
@@ -345,7 +344,7 @@ func TestLfsUpload(t *testing.T) {
require.Equal(t, oid, r.Form.Get("file.sha256"), "Invalid SHA256 populated")
require.Equal(t, strconv.Itoa(len(reqBody)), r.Form.Get("file.size"), "Invalid size populated")
- tempfile, err := ioutil.ReadFile(r.Form.Get("file.path"))
+ tempfile, err := os.ReadFile(r.Form.Get("file.path"))
require.NoError(t, err)
require.Equal(t, reqBody, string(tempfile), "Temporary file has the wrong body")
@@ -369,7 +368,7 @@ func TestLfsUpload(t *testing.T) {
require.NoError(t, err)
defer resp.Body.Close()
- rspData, err := ioutil.ReadAll(resp.Body)
+ rspData, err := io.ReadAll(resp.Body)
require.NoError(t, err)
// Expect the (eventual) response to be proxied through, untouched
@@ -431,7 +430,7 @@ func TestLfsUploadRouting(t *testing.T) {
require.NoError(t, err)
defer resp.Body.Close()
- rspData, err := ioutil.ReadAll(resp.Body)
+ rspData, err := io.ReadAll(resp.Body)
require.NoError(t, err)
if tc.match {
@@ -470,7 +469,7 @@ func packageUploadTestServer(t *testing.T, method string, resource string, reqBo
require.Equal(t, len, r.Form.Get("file.size"), "Invalid size populated")
tmpFilePath := r.Form.Get("file.path")
- fileData, err := ioutil.ReadFile(tmpFilePath)
+ fileData, err := os.ReadFile(tmpFilePath)
defer os.Remove(tmpFilePath)
require.NoError(t, err)
@@ -499,7 +498,7 @@ func testPackageFileUpload(t *testing.T, method string, resource string) {
resp, err := http.DefaultClient.Do(req)
require.NoError(t, err)
- respData, err := ioutil.ReadAll(resp.Body)
+ respData, err := io.ReadAll(resp.Body)
require.NoError(t, err)
require.Equal(t, rspBody, string(respData), "Temporary file has the wrong body")
defer resp.Body.Close()