MCPcopy
hub / github.com/swaggo/swag / TestParseAcceptComment

Function TestParseAcceptComment

operation_test.go:35–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestParseAcceptComment(t *testing.T) {
36 t.Parallel()
37
38 comment := `/@Accept json,xml,plain,html,mpfd,x-www-form-urlencoded,json-api,json-stream,octet-stream,png,jpeg,gif,application/xhtml+xml,application/health+json`
39 operation := NewOperation(nil)
40 err := operation.ParseComment(comment, nil)
41 assert.NoError(t, err)
42 assert.Equal(t,
43 operation.Consumes,
44 []string{"application/json",
45 "text/xml",
46 "text/plain",
47 "text/html",
48 "multipart/form-data",
49 "application/x-www-form-urlencoded",
50 "application/vnd.api+json",
51 "application/x-json-stream",
52 "application/octet-stream",
53 "image/png",
54 "image/jpeg",
55 "image/gif",
56 "application/xhtml+xml",
57 "application/health+json"})
58}
59
60func TestParseAcceptCommentErr(t *testing.T) {
61 t.Parallel()

Callers

nothing calls this directly

Calls 2

ParseCommentMethod · 0.95
NewOperationFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…