MCPcopy
hub / github.com/syncthing/syncthing / testConfigPost

Function testConfigPost

lib/api/api_test.go:1281–1292  ·  view source on GitHub ↗
(t *testing.T, data io.Reader)

Source from the content-addressed store, hash-verified

1279}
1280
1281func testConfigPost(t *testing.T, data io.Reader) (*http.Response, error) {
1282 t.Helper()
1283
1284 baseURL := startHTTP(t, apiCfg)
1285 cli := &http.Client{
1286 Timeout: time.Second,
1287 }
1288
1289 req, _ := http.NewRequest("POST", baseURL+"/rest/system/config", data)
1290 req.Header.Set("X-API-Key", testAPIKey)
1291 return cli.Do(req)
1292}
1293
1294func TestHostCheck(t *testing.T) {
1295 t.Parallel()

Callers 2

TestConfigPostOKFunction · 0.85
TestConfigPostDupFolderFunction · 0.85

Calls 4

startHTTPFunction · 0.85
HelperMethod · 0.80
DoMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected