TestContextFileNotFound tests serving a non-existent file
(t *testing.T)
| 25 | |
| 26 | // TestContextFileNotFound tests serving a non-existent file |
| 27 | func TestContextFileNotFound(t *testing.T) { |
| 28 | w := httptest.NewRecorder() |
| 29 | c, _ := CreateTestContext(w) |
| 30 | c.Request = httptest.NewRequest(http.MethodGet, "/test", nil) |
| 31 | |
| 32 | c.File("non_existent_file.txt") |
| 33 | |
| 34 | assert.Equal(t, http.StatusNotFound, w.Code) |
| 35 | } |
nothing calls this directly
no test coverage detected