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

Function AssertHTTPErrorReason

rest/utilities_testing.go:2834–2844  ·  view source on GitHub ↗
(t testing.TB, response *TestResponse, expectedStatus int, expectedReason string)

Source from the content-addressed store, hash-verified

2832}
2833
2834func AssertHTTPErrorReason(t testing.TB, response *TestResponse, expectedStatus int, expectedReason string) {
2835 var httpError struct {
2836 Reason string `json:"reason"`
2837 }
2838 err := base.JSONUnmarshal(response.BodyBytes(), &httpError)
2839 require.NoError(t, err, "Failed to unmarshal HTTP error: %v", response.BodyBytes())
2840
2841 AssertStatus(t, response, expectedStatus)
2842
2843 assert.Equal(t, expectedReason, httpError.Reason)
2844}
2845
2846func AssertRevTreeAfterHLVConflictResolution(t *testing.T, doc *db.Document, expectedActiveRevTreeID, expectedTombstoneParentID string) {
2847 activeLeafCount := 0

Calls 4

JSONUnmarshalFunction · 0.92
AssertStatusFunction · 0.85
BodyBytesMethod · 0.45
EqualMethod · 0.45