(t *testing.T)
| 51 | } |
| 52 | |
| 53 | func TestAPI_GetSettings(t *testing.T) { |
| 54 | srv := newTestServer() |
| 55 | |
| 56 | req := httptest.NewRequest("GET", "/api/settings", nil) |
| 57 | w := httptest.NewRecorder() |
| 58 | |
| 59 | srv.handleGetSettings(w, req) |
| 60 | |
| 61 | if w.Code != http.StatusOK { |
| 62 | t.Errorf("Expected 200, got %d", w.Code) |
| 63 | } |
| 64 | |
| 65 | var resp SettingsResponse |
| 66 | json.Unmarshal(w.Body.Bytes(), &resp) |
| 67 | |
| 68 | if resp.CacheDir != testCacheDir { |
| 69 | t.Errorf("Expected cacheDir %s, got %s", testCacheDir, resp.CacheDir) |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | func TestAPI_GetSettings_TokenMasked(t *testing.T) { |
| 74 | cfg := Config{ |
nothing calls this directly
no test coverage detected