| 53 | } |
| 54 | |
| 55 | func TestPlanStringNoDeps(t *testing.T) { |
| 56 | p := &Plan{} |
| 57 | p.addNode(Operation{ |
| 58 | Type: OpCreateNetwork, |
| 59 | ResourceID: "network:default", |
| 60 | Cause: "not found", |
| 61 | }, "") |
| 62 | p.addNode(Operation{ |
| 63 | Type: OpCreateVolume, |
| 64 | ResourceID: "volume:data", |
| 65 | Cause: "not found", |
| 66 | }, "") |
| 67 | |
| 68 | expected := "[] -> #1 network:default, CreateNetwork, not found\n" + |
| 69 | "[] -> #2 volume:data, CreateVolume, not found\n" |
| 70 | assert.Equal(t, p.String(), expected) |
| 71 | assert.Assert(t, !p.IsEmpty()) |
| 72 | } |
| 73 | |
| 74 | func TestPlanStringWithDeps(t *testing.T) { |
| 75 | p := &Plan{} |