MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / TestFindVMByIDInGroup_NotFound

Function TestFindVMByIDInGroup_NotFound

pkg/api/grouped_cluster_test.go:339–354  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

337}
338
339func TestFindVMByIDInGroup_NotFound(t *testing.T) {
340 s1 := newSingleNodeWithVMServer("t1", "pve1", 100, "web", "running")
341 defer s1.Close()
342
343 mgr := NewGroupClientManager("g", testutils.NewTestLogger(), &MockCache{})
344 err := mgr.Initialize(context.Background(), []ProfileEntry{
345 {Name: "prod", Config: &MockConfig{Addr: s1.URL, User: "u", Password: "p"}},
346 })
347 require.NoError(t, err)
348
349 _, _, err = mgr.FindVMByIDInGroup(context.Background(), 999)
350 require.Error(t, err)
351
352 var ambig *AmbiguousVMIDError
353 assert.False(t, errors.As(err, &ambig), "not-found should not be AmbiguousVMIDError")
354}
355
356func TestDeduplicateGroupVMs(t *testing.T) {
357 vms := []*VM{

Callers

nothing calls this directly

Calls 7

InitializeMethod · 0.95
FindVMByIDInGroupMethod · 0.95
NewTestLoggerFunction · 0.92
NewGroupClientManagerFunction · 0.85
CloseMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected