MCPcopy
hub / github.com/docker/compose / TestReconcileVolumes_CreateMissing

Function TestReconcileVolumes_CreateMissing

pkg/compose/reconcile_test.go:222–240  ·  view source on GitHub ↗

--- Volume tests ---

(t *testing.T)

Source from the content-addressed store, hash-verified

220// --- Volume tests ---
221
222func 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
242func TestReconcileVolumes_ExistingMatch(t *testing.T) {
243 vol := types.VolumeConfig{Name: "myproject_data", Driver: "local"}

Callers

nothing calls this directly

Calls 3

reconcileFunction · 0.85
defaultReconcileOptionsFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected