~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/cmd/juju/subnet/package_test.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
var _ = gc.Suite(&BaseSubnetSuite{})
40
40
 
 
41
func (s *BaseSubnetSuite) SetUpSuite(c *gc.C) {
 
42
        s.FakeJujuXDGDataHomeSuite.SetUpSuite(c)
 
43
        s.BaseSuite.SetUpSuite(c)
 
44
}
 
45
 
 
46
func (s *BaseSubnetSuite) TearDownSuite(c *gc.C) {
 
47
        s.BaseSuite.TearDownSuite(c)
 
48
        s.FakeJujuXDGDataHomeSuite.TearDownSuite(c)
 
49
}
 
50
 
41
51
func (s *BaseSubnetSuite) SetUpTest(c *gc.C) {
42
52
        // If any post-MVP command suite enabled the flag, keep it.
43
53
        hasFeatureFlag := featureflag.Enabled(feature.PostNetCLIMVP)
59
69
        // s.command immediately after calling this method!
60
70
}
61
71
 
 
72
func (s *BaseSubnetSuite) TearDownTest(c *gc.C) {
 
73
        s.BaseSuite.TearDownTest(c)
 
74
        s.FakeJujuXDGDataHomeSuite.TearDownTest(c)
 
75
}
 
76
 
62
77
// RunSuperCommand executes the super command passing any args and
63
78
// returning the stdout and stderr output as strings, as well as any
64
79
// error. If s.command is set, the subcommand's name will be passed as
125
140
                // Subcommands embed ModelCommandBase and have an extra
126
141
                // "[options]" prepended before the args.
127
142
                cmdInfo = s.command.Info()
128
 
                expected = "(?sm).*^usage: juju subnet " +
 
143
                expected = "(?sm).*^Usage: juju subnet " +
129
144
                        regexp.QuoteMeta(cmdInfo.Name) +
130
145
                        `( \[options\])? ` + regexp.QuoteMeta(cmdInfo.Args) + ".+"
131
146
        } else {
132
 
                expected = "(?sm).*^usage: juju subnet" +
 
147
                expected = "(?sm).*^Usage: juju subnet" +
133
148
                        `( \[options\])? ` + regexp.QuoteMeta(cmdInfo.Args) + ".+"
134
149
        }
135
150
        c.Check(cmdInfo, gc.NotNil)
136
151
        c.Check(stderr, gc.Matches, expected)
137
152
 
138
 
        expected = "(?sm).*^purpose: " + regexp.QuoteMeta(cmdInfo.Purpose) + "$.*"
 
153
        expected = "(?sm).*^Summary:\n" + regexp.QuoteMeta(cmdInfo.Purpose) + "$.*"
139
154
        c.Check(stderr, gc.Matches, expected)
140
155
 
141
 
        expected = "(?sm).*^" + regexp.QuoteMeta(cmdInfo.Doc) + "$.*"
 
156
        expected = "(?sm).*^Details:\n" + regexp.QuoteMeta(cmdInfo.Doc) + "$.*"
142
157
        c.Check(stderr, gc.Matches, expected)
143
158
}
144
159