Skip to content

Commit

Permalink
refactor(test): fixed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
inlag committed Jun 13, 2024
1 parent d69a502 commit 4c44541
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
12 changes: 1 addition & 11 deletions src/handlers/docs/handleDocUpload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ func TestHandleDocUpload_NoError(t *testing.T) {
defer writer.Close()
part, _ := writer.CreateFormFile("doc", "filename.txt")
part.Write(testDataFile)

//h := make(textproto.MIMEHeader)
//h.Set("Content-Disposition", fmt.Sprintf(
// `form-data; name="%s"; filename="%s"`,
// EscapeQuotes("doc"),
// EscapeQuotes("file.txt"),
//))
//h.Set("Content-Type", "text/plain; charset=utf-8")
//part, _ := writer.CreatePart(h)
}()

// init request
Expand Down Expand Up @@ -129,7 +120,6 @@ func TestHandleDocUpload_ReadFailed_EOF(t *testing.T) {
HandleDocUpload(c)

// assert
fmt.Println(w.Body.String())
require.Equal(t, http.StatusInternalServerError, w.Result().StatusCode)
require.Equal(t, w.Body.String(), "Failed to read file: EOF")
}
Expand Down Expand Up @@ -254,7 +244,7 @@ func TestHandleDocUpload_FileExist(t *testing.T) {
// second handling
HandleDocUpload(cc)

//// first statement
// second statement
require.Equal(t, http.StatusConflict, ww.Result().StatusCode)
require.Equal(t, ww.Body.String(), "\"File already exists\"")
}
3 changes: 1 addition & 2 deletions src/handlers/image/handleImageUpload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ func TestHandleImageUpload_ReadFailed_EOF(t *testing.T) {
HandleImageUpload(c)

// assert
fmt.Println(w.Body.String())
require.Equal(t, http.StatusInternalServerError, w.Result().StatusCode)
require.Equal(t, w.Body.String(), "Failed to read file: EOF")
}
Expand Down Expand Up @@ -248,7 +247,7 @@ func TestHandleImageUpload_FileExist(t *testing.T) {
// second handling
HandleImageUpload(cc)

//// first statement
// second statement
require.Equal(t, http.StatusConflict, ww.Result().StatusCode)
require.Equal(t, ww.Body.String(), "\"File already exists\"")
}

0 comments on commit 4c44541

Please sign in to comment.