MCPcopy
hub / github.com/syncthing/syncthing / TestAPIServiceRequests

Function TestAPIServiceRequests

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

Source from the content-addressed store, hash-verified

218}
219
220func TestAPIServiceRequests(t *testing.T) {
221 t.Parallel()
222
223 baseURL := startHTTP(t, apiCfg)
224
225 cases := []httpTestCase{
226 // /rest/db
227 {
228 URL: "/rest/db/completion?device=" + protocol.LocalDeviceID.String() + "&folder=default",
229 Code: 200,
230 Type: "application/json",
231 Prefix: "{",
232 Timeout: 15 * time.Second,
233 },
234 {
235 URL: "/rest/db/file?folder=default&file=something",
236 Code: 404,
237 },
238 {
239 URL: "/rest/db/ignores?folder=default",
240 Code: 200,
241 Type: "application/json",
242 Prefix: "{",
243 },
244 {
245 URL: "/rest/db/need?folder=default",
246 Code: 200,
247 Type: "application/json",
248 Prefix: "{",
249 },
250 {
251 URL: "/rest/db/status?folder=default",
252 Code: 200,
253 Type: "application/json",
254 Prefix: "{",
255 },
256 {
257 URL: "/rest/db/browse?folder=default",
258 Code: 200,
259 Type: "application/json",
260 Prefix: "null",
261 },
262 {
263 URL: "/rest/db/status?folder=default",
264 Code: 200,
265 Type: "application/json",
266 Prefix: "",
267 },
268
269 // /rest/stats
270 {
271 URL: "/rest/stats/device",
272 Code: 200,
273 Type: "application/json",
274 Prefix: "null",
275 },
276 {
277 URL: "/rest/stats/folder",

Callers

nothing calls this directly

Calls 4

startHTTPFunction · 0.85
testHTTPRequestFunction · 0.85
StringMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected