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

Function TestReconcileNetworks_ExistingMatch

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

Source from the content-addressed store, hash-verified

68}
69
70func TestReconcileNetworks_ExistingMatch(t *testing.T) {
71 nw := types.NetworkConfig{Name: "myproject_frontend"}
72 hash, err := NetworkHash(&nw)
73 assert.NilError(t, err)
74
75 project := &types.Project{
76 Name: "myproject",
77 Networks: types.Networks{"frontend": nw},
78 }
79 observed := &ObservedState{
80 ProjectName: "myproject",
81 Containers: map[string][]ObservedContainer{},
82 Networks: map[string]ObservedNetwork{
83 "frontend": {ID: "net1", Name: "myproject_frontend", ConfigHash: hash},
84 },
85 Volumes: map[string]ObservedVolume{},
86 }
87
88 plan, err := reconcile(t.Context(), project, observed, defaultReconcileOptions(), noPrompt)
89 assert.NilError(t, err)
90 assert.Assert(t, plan.IsEmpty())
91}
92
93func TestReconcileNetworks_ExternalSkipped(t *testing.T) {
94 project := &types.Project{

Callers

nothing calls this directly

Calls 4

NetworkHashFunction · 0.85
reconcileFunction · 0.85
defaultReconcileOptionsFunction · 0.85
IsEmptyMethod · 0.45

Tested by

no test coverage detected