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

Function TestGetMetricConfiguration

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

Source from the content-addressed store, hash-verified

224}
225
226func TestGetMetricConfiguration(t *testing.T) {
227 var (
228 target *orchestrator.CertificationTarget
229 svc *service_orchestrator.Service
230
231 err error
232 b bytes.Buffer
233 )
234
235 svc = service_orchestrator.NewService()
236 _, err = clitest.RunCLITestFunc(func() bool {
237 target, err = svc.CreateDefaultCertificationTarget()
238 assert.NoError(t, err)
239 // target should be not nil since there are no stored certification targets yet
240 assert.NotNil(t, target)
241
242 cli.Output = &b
243
244 // create a new target service
245 target, err = svc.RegisterCertificationTarget(context.TODO(), &orchestrator.RegisterCertificationTargetRequest{CertificationTarget: &orchestrator.CertificationTarget{Name: "myTarget"}})
246
247 assert.NotNil(t, target)
248 assert.NoError(t, err)
249
250 cmd := NewGetMetricConfigurationCommand()
251 err = cmd.RunE(nil, []string{target.Id, "TransportEncryptionEnabled"})
252
253 return assert.NoError(t, err)
254 }, server.WithServices(svc))
255 assert.NoError(t, err)
256}

Callers

nothing calls this directly

Calls 7

RunCLITestFuncFunction · 0.92
NotNilFunction · 0.92
WithServicesFunction · 0.92
NewServiceMethod · 0.65

Tested by

no test coverage detected