(t *testing.T)
| 705 | } |
| 706 | |
| 707 | func TestHandleConfig_ReadOnly(t *testing.T) { |
| 708 | cfg := Config{ReadOnly: true} |
| 709 | |
| 710 | req := httptest.NewRequest(http.MethodGet, "/api/config", nil) |
| 711 | rec := httptest.NewRecorder() |
| 712 | |
| 713 | handleConfig(cfg)(rec, req) |
| 714 | |
| 715 | if rec.Code != http.StatusOK { |
| 716 | t.Fatalf("expected 200, got %d", rec.Code) |
| 717 | } |
| 718 | |
| 719 | var resp ConfigResponse |
| 720 | if err := json.Unmarshal(rec.Body.Bytes(), &resp); err != nil { |
| 721 | t.Fatalf("invalid JSON: %v", err) |
| 722 | } |
| 723 | if !resp.ReadOnly { |
| 724 | t.Error("expected readonly to be true") |
| 725 | } |
| 726 | } |
| 727 | |
| 728 | func TestHandleUpdateTask_ReadOnly(t *testing.T) { |
| 729 | dir := createTestTaskDir(t) |
nothing calls this directly
no test coverage detected