| 72 | } |
| 73 | |
| 74 | func 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 | |
| 98 | func TestPlanStringWithGroup(t *testing.T) { |
| 99 | p := &Plan{} |