MCPcopy Create free account
hub / github.com/bodaay/HuggingFaceModelDownloader / TestAPI_GetSettings

Function TestAPI_GetSettings

internal/server/api_test.go:53–71  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

51}
52
53func 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
73func TestAPI_GetSettings_TokenMasked(t *testing.T) {
74 cfg := Config{

Callers

nothing calls this directly

Calls 2

newTestServerFunction · 0.85
handleGetSettingsMethod · 0.80

Tested by

no test coverage detected