(t *testing.T)
| 87 | } |
| 88 | |
| 89 | func TestStorageListJSONShape(t *testing.T) { |
| 90 | server := newStorageTestServer(t) |
| 91 | defer server.Close() |
| 92 | |
| 93 | client := newTestClient(t, server.URL) |
| 94 | |
| 95 | rows, err := fetchStorageRows(client, "pve01") |
| 96 | if err != nil { |
| 97 | t.Fatalf("fetchStorageRows returned error: %v", err) |
| 98 | } |
| 99 | |
| 100 | // Round-trip through JSON to verify the output shape matches the spec. |
| 101 | data, err := json.Marshal(rows) |
| 102 | if err != nil { |
| 103 | t.Fatalf("json.Marshal: %v", err) |
| 104 | } |
| 105 | |
| 106 | var decoded []storageListRow |
| 107 | if err := json.Unmarshal(data, &decoded); err != nil { |
| 108 | t.Fatalf("output is not valid JSON array of storage rows: %v", err) |
| 109 | } |
| 110 | |
| 111 | if len(decoded) != len(rows) { |
| 112 | t.Errorf("decoded %d rows, want %d", len(decoded), len(rows)) |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | func TestStorageContentListReturnsItems(t *testing.T) { |
| 117 | server := newStorageTestServer(t) |
nothing calls this directly
no test coverage detected