MCPcopy Create free account
hub / github.com/clouditor/clouditor / TestListCertificationTargetsCommand

Function TestListCertificationTargetsCommand

cli/commands/cloud/cloud_test.go:91–118  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

89}
90
91func TestListCertificationTargetsCommand(t *testing.T) {
92 var (
93 response orchestrator.ListCertificationTargetsResponse
94 svc *service_orchestrator.Service
95
96 err error
97 b bytes.Buffer
98 )
99
100 svc = service_orchestrator.NewService()
101 _, err = clitest.RunCLITestFunc(func() bool {
102 _, err = svc.CreateDefaultCertificationTarget()
103 assert.NoError(t, err)
104
105 cli.Output = &b
106
107 cmd := NewListCertificationTargetsCommand()
108 err = cmd.RunE(nil, []string{})
109
110 assert.NoError(t, err)
111
112 err = protojson.Unmarshal(b.Bytes(), &response)
113
114 assert.NoError(t, err)
115 return assert.NotEmpty(t, response.Targets)
116 }, server.WithServices(svc))
117 assert.NoError(t, err)
118}
119
120func TestGetCertificationTargetCommand(t *testing.T) {
121 var (

Callers

nothing calls this directly

Calls 5

RunCLITestFuncFunction · 0.92
WithServicesFunction · 0.92
NewServiceMethod · 0.65

Tested by

no test coverage detected