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

Function TestClientInit

http/codegen/client_init_test.go:13–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestClientInit(t *testing.T) {
14 cases := []struct {
15 Name string
16 DSL func()
17 FileCount int
18 SectionNum int
19 }{
20 {"multiple endpoints", testdata.ServerMultiEndpointsDSL, 2, 2},
21 {"streaming", testdata.StreamingResultDSL, 3, 2},
22 }
23 for _, c := range cases {
24 t.Run(c.Name, func(t *testing.T) {
25 root := RunHTTPDSL(t, c.DSL)
26 services := CreateHTTPServices(root)
27 fs := ClientFiles("", services)
28 require.Len(t, fs, c.FileCount)
29 sections := fs[0].SectionTemplates
30 require.Greater(t, len(sections), c.SectionNum)
31 code := codegen.SectionCode(t, sections[c.SectionNum])
32 testutil.AssertGo(t, "testdata/golden/client_init_"+c.Name+".go.golden", code)
33 })
34 }
35}

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