MCPcopy
hub / github.com/syncthing/syncthing / TestConfigPostDupFolder

Function TestConfigPostDupFolder

lib/api/api_test.go:1261–1279  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1259}
1260
1261func TestConfigPostDupFolder(t *testing.T) {
1262 t.Parallel()
1263
1264 cfg := bytes.NewBuffer([]byte(`{
1265 "version": 15,
1266 "folders": [
1267 {"id": "foo"},
1268 {"id": "foo"}
1269 ]
1270 }`))
1271
1272 resp, err := testConfigPost(t, cfg)
1273 if err != nil {
1274 t.Fatal(err)
1275 }
1276 if resp.StatusCode != http.StatusBadRequest {
1277 t.Error("Expected 400 Bad Request, not", resp.Status)
1278 }
1279}
1280
1281func testConfigPost(t *testing.T, data io.Reader) (*http.Response, error) {
1282 t.Helper()

Callers

nothing calls this directly

Calls 3

testConfigPostFunction · 0.85
FatalMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected