Skip to content

Commit f95ea3a

Browse files
committed
Refactor suite-test template
1 parent ac57a35 commit f95ea3a

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

testing/codegen/templates/suite_test.go.tpl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ func Run{{ .Service.StructName }}Harness(t *testing.T, svc {{ .Service.PkgName }
1515
{{- range .NonStream }}
1616
{{- $m := . }}
1717
t.Run("{{ $m.Method.Name }}", func(t *testing.T) {
18-
{{- if $m.Method.PayloadEx }}
19-
result, err := h.Client.{{ $m.Method.VarName }}({{ if $.UseCtx }}ctx{{ else }}context.Background(){{ end }}, td.Valid{{ goify $m.Method.Name true }}Payload())
20-
{{- else }}
21-
result, err := h.Client.{{ $m.Method.VarName }}({{ if $.UseCtx }}ctx{{ else }}context.Background(){{ end }})
22-
{{- end }}
18+
result, err := h.Client.{{ $m.Method.VarName }}({{ if $.UseCtx }}ctx{{ else }}context.Background(){{ end }}{{- if $m.Method.PayloadEx }}, td.Valid{{ goify $m.Method.Name true }}Payload(){{ end }})
2319
if err != nil {
2420
t.Errorf("{{ $m.Method.Name }} failed: %v", err)
2521
}
@@ -116,4 +112,4 @@ func Run{{ .Service.StructName }}Harness(t *testing.T, svc {{ .Service.PkgName }
116112
{{- end }}
117113
})
118114
{{- end }}
119-
}
115+
}

0 commit comments

Comments
 (0)