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

Function TestPlanStringWithDeps

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

Source from the content-addressed store, hash-verified

72}
73
74func TestPlanStringWithDeps(t *testing.T) {
75 p := &Plan{}
76 nw := p.addNode(Operation{
77 Type: OpCreateNetwork,
78 ResourceID: "network:default",
79 Cause: "not found",
80 }, "")
81 vol := p.addNode(Operation{
82 Type: OpCreateVolume,
83 ResourceID: "volume:data",
84 Cause: "not found",
85 }, "")
86 p.addNode(Operation{
87 Type: OpCreateContainer,
88 ResourceID: "service:db:1",
89 Cause: "no existing container",
90 }, "", nw, vol)
91
92 expected := "[] -> #1 network:default, CreateNetwork, not found\n" +
93 "[] -> #2 volume:data, CreateVolume, not found\n" +
94 "[1,2] -> #3 service:db:1, CreateContainer, no existing container\n"
95 assert.Equal(t, p.String(), expected)
96}
97
98func TestPlanStringWithGroup(t *testing.T) {
99 p := &Plan{}

Callers

nothing calls this directly

Calls 2

addNodeMethod · 0.95
StringMethod · 0.95

Tested by

no test coverage detected