(t *testing.T)
| 163 | } |
| 164 | |
| 165 | func TestHandleTaskByID_EmptyID(t *testing.T) { |
| 166 | dir := createTestTaskDir(t) |
| 167 | dp := NewDataProvider(dir, false) |
| 168 | |
| 169 | req := httptest.NewRequest(http.MethodGet, "/api/tasks/", nil) |
| 170 | rec := httptest.NewRecorder() |
| 171 | |
| 172 | handleTaskByID(dp)(rec, req) |
| 173 | |
| 174 | if rec.Code != http.StatusBadRequest { |
| 175 | t.Fatalf("expected 400, got %d", rec.Code) |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | func TestHandleTaskByID_NotFound(t *testing.T) { |
| 180 | dir := createTestTaskDir(t) |
nothing calls this directly
no test coverage detected