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

Function TestClientCLIFiles

grpc/codegen/client_cli_test.go:14–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestClientCLIFiles(t *testing.T) {
15 cases := []struct {
16 Name string
17 DSL func()
18 }{
19 {"payload-with-validations", testdata.PayloadWithValidationsDSL},
20 }
21
22 for _, c := range cases {
23 t.Run(c.Name, func(t *testing.T) {
24 root := RunGRPCDSL(t, c.DSL)
25 services := CreateGRPCServices(root)
26 fs := ClientCLIFiles("", services)
27 require.Greater(t, len(fs), 1, "expected at least 2 files")
28 require.NotEmpty(t, fs[1].SectionTemplates)
29 var buf bytes.Buffer
30 for _, s := range fs[1].SectionTemplates {
31 require.NoError(t, s.Write(&buf))
32 }
33 code := codegen.FormatTestCode(t, buf.String())
34 testutil.AssertGo(t, "testdata/golden/client_cli_"+c.Name+".go.golden", code)
35 })
36 }
37}

Callers

nothing calls this directly

Calls 8

FormatTestCodeFunction · 0.92
AssertGoFunction · 0.92
RunGRPCDSLFunction · 0.85
CreateGRPCServicesFunction · 0.85
ClientCLIFilesFunction · 0.70
StringMethod · 0.65
RunMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected