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

Function TestReconcileContainers_NewProject

pkg/compose/reconcile_test.go:333–353  ·  view source on GitHub ↗

--- Container tests ---

(t *testing.T)

Source from the content-addressed store, hash-verified

331// --- Container tests ---
332
333func TestReconcileContainers_NewProject(t *testing.T) {
334 project := &types.Project{
335 Name: "myproject",
336 Services: types.Services{
337 "web": {Name: "web", Scale: intPtr(1)},
338 },
339 }
340 observed := &ObservedState{
341 ProjectName: "myproject",
342 Containers: map[string][]ObservedContainer{"web": {}},
343 Networks: map[string]ObservedNetwork{},
344 Volumes: map[string]ObservedVolume{},
345 }
346
347 plan, err := reconcile(t.Context(), project, observed, defaultReconcileOptions(), noPrompt)
348 assert.NilError(t, err)
349
350 assert.Equal(t, plan.String(), strings.TrimSpace(`
351[] -> #1 service:web:1, CreateContainer, no existing container
352`)+"\n")
353}
354
355func TestReconcileContainers_AlreadyRunning(t *testing.T) {
356 svc := types.ServiceConfig{Name: "web", Scale: intPtr(1)}

Callers

nothing calls this directly

Calls 4

intPtrFunction · 0.85
reconcileFunction · 0.85
defaultReconcileOptionsFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected