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

Function TestAPI_UpdateSettings

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

Source from the content-addressed store, hash-verified

95}
96
97func TestAPI_UpdateSettings(t *testing.T) {
98 srv := newTestServer()
99
100 // Update concurrency
101 body := `{"connections": 16, "maxActive": 8}`
102 req := httptest.NewRequest("POST", "/api/settings", bytes.NewBufferString(body))
103 req.Header.Set("Content-Type", "application/json")
104 w := httptest.NewRecorder()
105
106 srv.handleUpdateSettings(w, req)
107
108 if w.Code != http.StatusOK {
109 t.Errorf("Expected 200, got %d", w.Code)
110 }
111
112 // Verify changes applied
113 if srv.config.Concurrency != 16 {
114 t.Errorf("Expected concurrency 16, got %d", srv.config.Concurrency)
115 }
116 if srv.config.MaxActive != 8 {
117 t.Errorf("Expected maxActive 8, got %d", srv.config.MaxActive)
118 }
119}
120
121func TestAPI_UpdateSettings_CantChangeCacheDir(t *testing.T) {
122 srv := newTestServer()

Callers

nothing calls this directly

Calls 2

newTestServerFunction · 0.85
handleUpdateSettingsMethod · 0.80

Tested by

no test coverage detected