tested real proxmox connection
--> passed
This commit is contained in:
@@ -48,7 +48,7 @@ func TestListTemplatesReturnsTemplates(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestListTemplatesReturnsEmptyList(t *testing.T) {
|
||||
handler := NewHandler(&stubRepository{templates: []Template{}})
|
||||
handler := NewHandler(&stubRepository{})
|
||||
req := httptest.NewRequest(http.MethodGet, "/internal/templates", nil)
|
||||
rec := httptest.NewRecorder()
|
||||
|
||||
@@ -57,6 +57,9 @@ func TestListTemplatesReturnsEmptyList(t *testing.T) {
|
||||
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 TestCreateTemplateReturnsCreated(t *testing.T) {
|
||||
@@ -205,4 +208,4 @@ func (s *stubRepository) Upsert(_ context.Context, _ Template) (Template, error)
|
||||
|
||||
func (s *stubRepository) Delete(_ context.Context, _ string) (bool, error) {
|
||||
return s.deleteResult, nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user