82
82
purpose: ensure a port is always closed
86
// Since the deprecation warning gets output during Run, we really need
87
// some valid commands to run
88
var portsFormatDeprectaionTests = []struct {
91
{[]string{"open-port", "--format", "foo", "80"}},
92
{[]string{"close-port", "--format", "foo", "80/TCP"}},
95
func (s *PortsSuite) TestOpenCloseDeprecation(c *C) {
96
hctx := s.GetHookContext(c, -1, "")
97
for _, t := range portsFormatDeprectaionTests {
99
com, err := jujuc.NewCommand(hctx, name)
101
ctx := testing.Context(c)
102
code := cmd.Main(com, ctx, t.cmd[1:])
103
c.Assert(code, Equals, 0)
104
c.Assert(testing.Stdout(ctx), Equals, "")
105
c.Assert(testing.Stderr(ctx), Equals, "--format flag deprecated for command \""+name+"\"")