MCPcopy Index your code
hub / github.com/syncthing/syncthing / TestConfigPostOK

Function TestConfigPostOK

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

Source from the content-addressed store, hash-verified

1236}
1237
1238func TestConfigPostOK(t *testing.T) {
1239 t.Parallel()
1240
1241 cfg := bytes.NewBuffer([]byte(`{
1242 "version": 15,
1243 "folders": [
1244 {
1245 "id": "foo",
1246 "path": "TestConfigPostOK"
1247 }
1248 ]
1249 }`))
1250
1251 resp, err := testConfigPost(t, cfg)
1252 if err != nil {
1253 t.Fatal(err)
1254 }
1255 if resp.StatusCode != http.StatusOK {
1256 t.Error("Expected 200 OK, not", resp.Status)
1257 }
1258 os.RemoveAll("TestConfigPostOK")
1259}
1260
1261func TestConfigPostDupFolder(t *testing.T) {
1262 t.Parallel()

Callers

nothing calls this directly

Calls 4

testConfigPostFunction · 0.85
FatalMethod · 0.80
ErrorMethod · 0.65
RemoveAllMethod · 0.65

Tested by

no test coverage detected