--- Volume tests ---
(t *testing.T)
| 220 | // --- Volume tests --- |
| 221 | |
| 222 | func TestReconcileVolumes_CreateMissing(t *testing.T) { |
| 223 | project := &types.Project{ |
| 224 | Name: "myproject", |
| 225 | Volumes: types.Volumes{"data": {Name: "myproject_data"}}, |
| 226 | } |
| 227 | observed := &ObservedState{ |
| 228 | ProjectName: "myproject", |
| 229 | Containers: map[string][]ObservedContainer{}, |
| 230 | Networks: map[string]ObservedNetwork{}, |
| 231 | Volumes: map[string]ObservedVolume{}, |
| 232 | } |
| 233 | |
| 234 | plan, err := reconcile(t.Context(), project, observed, defaultReconcileOptions(), noPrompt) |
| 235 | assert.NilError(t, err) |
| 236 | |
| 237 | assert.Equal(t, plan.String(), strings.TrimSpace(` |
| 238 | [] -> #1 volume:data, CreateVolume, not found |
| 239 | `)+"\n") |
| 240 | } |
| 241 | |
| 242 | func TestReconcileVolumes_ExistingMatch(t *testing.T) { |
| 243 | vol := types.VolumeConfig{Name: "myproject_data", Driver: "local"} |
nothing calls this directly
no test coverage detected