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

Function TestPlanAddNodeAutoIncrements

pkg/compose/plan_test.go:128–140  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

126}
127
128func TestPlanAddNodeAutoIncrements(t *testing.T) {
129 p := &Plan{}
130 n1 := p.addNode(Operation{Type: OpCreateNetwork, ResourceID: "a", Cause: "x"}, "")
131 n2 := p.addNode(Operation{Type: OpCreateVolume, ResourceID: "b", Cause: "y"}, "")
132 n3 := p.addNode(Operation{Type: OpCreateContainer, ResourceID: "c", Cause: "z"}, "", n1, n2)
133
134 assert.Equal(t, n1.ID, 1)
135 assert.Equal(t, n2.ID, 2)
136 assert.Equal(t, n3.ID, 3)
137 assert.Equal(t, len(n3.DependsOn), 2)
138 assert.Equal(t, n3.DependsOn[0].ID, 1)
139 assert.Equal(t, n3.DependsOn[1].ID, 2)
140}

Callers

nothing calls this directly

Calls 1

addNodeMethod · 0.95

Tested by

no test coverage detected