MCPcopy Create free account
hub / github.com/goadesign/goa / TestClientMultipartNewFunc

Function TestClientMultipartNewFunc

http/codegen/multipart_test.go:90–115  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

88}
89
90func TestClientMultipartNewFunc(t *testing.T) {
91 const genpkg = "gen"
92 cases := []struct {
93 Name string
94 DSL func()
95 }{
96 {"client-multipart-body-primitive", testdata.PayloadMultipartPrimitiveDSL},
97 {"client-multipart-body-user-type", testdata.PayloadMultipartUserTypeDSL},
98 {"client-multipart-body-array-type", testdata.PayloadMultipartArrayTypeDSL},
99 {"client-multipart-body-map-type", testdata.PayloadMultipartMapTypeDSL},
100 {"client-multipart-with-param", testdata.PayloadMultipartWithParamDSL},
101 {"client-multipart-with-params-and-headers", testdata.PayloadMultipartWithParamsAndHeadersDSL},
102 }
103 for _, c := range cases {
104 t.Run(c.Name, func(t *testing.T) {
105 root := RunHTTPDSL(t, c.DSL)
106 services := CreateHTTPServices(root)
107 fs := ClientFiles(genpkg, services)
108 require.Len(t, fs, 2)
109 sections := fs[1].SectionTemplates
110 require.Greater(t, len(sections), 3)
111 code := codegen.SectionCode(t, sections[3])
112 testutil.AssertGo(t, "testdata/golden/client_multipart_"+c.Name+".go.golden", code)
113 })
114 }
115}

Callers

nothing calls this directly

Calls 6

SectionCodeFunction · 0.92
AssertGoFunction · 0.92
RunHTTPDSLFunction · 0.85
CreateHTTPServicesFunction · 0.85
ClientFilesFunction · 0.70
RunMethod · 0.45

Tested by

no test coverage detected