Integration tests for storage commands. These tests use a local httptest server to simulate the Proxmox API and exercise the full command handler pipeline (flag parsing → API call → JSON output). They are separate from unit tests because they wire up a real api.Client and go through initCLISession
()
| 17 | |
| 18 | // storageListResponse returns a minimal /nodes/{node}/storage JSON response. |
| 19 | func storageListResponse() string { |
| 20 | return `{"data":[ |
| 21 | {"storage":"local","plugintype":"dir","content":"vztmpl,iso,backup","disk":1073741824,"maxdisk":10737418240,"status":"available","shared":0,"type":"storage","node":"pve01"}, |
| 22 | {"storage":"local-zfs","plugintype":"zfspool","content":"images,rootdir","disk":5368709120,"maxdisk":21474836480,"status":"available","shared":0,"type":"storage","node":"pve01"} |
| 23 | ]}` |
| 24 | } |
| 25 | |
| 26 | // storageContentResponse returns a minimal /nodes/{node}/storage/{storage}/content JSON response. |
| 27 | func storageContentResponse() string { |
no outgoing calls
no test coverage detected