MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / TestDeleteNonExistentDoc

Function TestDeleteNonExistentDoc

rest/api_test.go:2431–2451  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2429}
2430
2431func TestDeleteNonExistentDoc(t *testing.T) {
2432 rt := NewRestTester(t, nil)
2433 defer rt.Close()
2434
2435 response := rt.SendAdminRequest("DELETE", "/{{.keyspace}}/fake", "")
2436 RequireStatus(t, response, http.StatusOK)
2437
2438 response = rt.SendAdminRequest("GET", "/{{.keyspace}}/fake", "")
2439 RequireStatus(t, response, http.StatusNotFound)
2440
2441 var body map[string]interface{}
2442 _, err := rt.GetSingleDataStore().Get("fake", &body)
2443
2444 if base.TestUseXattrs() {
2445 assert.Error(t, err)
2446 assert.True(t, base.IsDocNotFoundError(err))
2447 assert.Nil(t, body)
2448 } else {
2449 assert.NoError(t, err)
2450 }
2451}
2452
2453// CBG-1153
2454func TestDeleteEmptyBodyDoc(t *testing.T) {

Callers

nothing calls this directly

Calls 9

CloseMethod · 0.95
SendAdminRequestMethod · 0.95
GetSingleDataStoreMethod · 0.95
TestUseXattrsFunction · 0.92
IsDocNotFoundErrorFunction · 0.92
NewRestTesterFunction · 0.85
RequireStatusFunction · 0.85
GetMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected