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

Function TestReconcileVolumes_ExistingMatch

pkg/compose/reconcile_test.go:242–263  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

240}
241
242func TestReconcileVolumes_ExistingMatch(t *testing.T) {
243 vol := types.VolumeConfig{Name: "myproject_data", Driver: "local"}
244 hash, err := VolumeHash(vol)
245 assert.NilError(t, err)
246
247 project := &types.Project{
248 Name: "myproject",
249 Volumes: types.Volumes{"data": vol},
250 }
251 observed := &ObservedState{
252 ProjectName: "myproject",
253 Containers: map[string][]ObservedContainer{},
254 Networks: map[string]ObservedNetwork{},
255 Volumes: map[string]ObservedVolume{
256 "data": {Name: "myproject_data", ConfigHash: hash},
257 },
258 }
259
260 plan, err := reconcile(t.Context(), project, observed, defaultReconcileOptions(), noPrompt)
261 assert.NilError(t, err)
262 assert.Assert(t, plan.IsEmpty())
263}
264
265func TestReconcileVolumes_ExternalSkipped(t *testing.T) {
266 project := &types.Project{

Callers

nothing calls this directly

Calls 4

VolumeHashFunction · 0.85
reconcileFunction · 0.85
defaultReconcileOptionsFunction · 0.85
IsEmptyMethod · 0.45

Tested by

no test coverage detected