tested real proxmox connection

--> passed
This commit is contained in:
Philipp
2026-06-12 14:25:34 +02:00
parent 1bfc46f03b
commit 452d1fb8b3
9 changed files with 271 additions and 42 deletions
+16
View File
@@ -57,6 +57,22 @@ func TestListProjectVMsReturnsVisibleVMs(t *testing.T) {
}
}
func TestListProjectVMsReturnsEmptyArray(t *testing.T) {
handler := NewHandler(&stubRepository{listFound: true})
req := requestWithPrincipal(http.MethodGet, "/projects/project-1/vms")
req.SetPathValue("projectID", "project-1")
rec := httptest.NewRecorder()
handler.ListProjectVMs(rec, req)
if rec.Code != http.StatusOK {
t.Fatalf("status = %d, want %d", rec.Code, http.StatusOK)
}
if got := rec.Body.String(); got != "{\"data\":[]}\n" {
t.Fatalf("body = %q, want empty data array", got)
}
}
func TestListProjectVMsReturnsNotFoundForInaccessibleProject(t *testing.T) {
handler := NewHandler(&stubRepository{listFound: false})
req := requestWithPrincipal(http.MethodGet, "/projects/project-1/vms")