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

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/tools/lxdclient/client_test.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
197
197
}
198
198
 
199
199
func (*ConnectSuite) CheckLogContains(c *gc.C, suffix string) {
200
 
        c.Check(c.GetTestLog(), jc.Contains, "WARNING juju.tools.lxdclient "+suffix)
 
200
        c.Check(c.GetTestLog(), gc.Matches, "(?s).*WARNING juju.tools.lxdclient "+suffix+".*")
201
201
}
202
202
 
203
203
func (*ConnectSuite) CheckVersionSupported(c *gc.C, version string, supported bool) {
206
206
 
207
207
func (cs *ConnectSuite) TestBadVersionChecks(c *gc.C) {
208
208
        cs.CheckVersionSupported(c, "foo", false)
209
 
        cs.CheckLogContains(c, `LXD API version "foo": expected format <major>.<minor>`)
 
209
        cs.CheckLogContains(c, `LXD API version "foo": expected format <major>\.<minor>`)
210
210
 
211
211
        cs.CheckVersionSupported(c, "a.b", false)
212
 
        cs.CheckLogContains(c, `LXD API version "a.b": unexpected major number: strconv.ParseInt: parsing "a": invalid syntax`)
 
212
        cs.CheckLogContains(c, `LXD API version "a.b": unexpected major number: strconv.(ParseInt|Atoi): parsing "a": invalid syntax`)
213
213
 
214
214
        cs.CheckVersionSupported(c, "0.9", false)
215
215
        cs.CheckLogContains(c, `LXD API version "0.9": expected major version 1 or later`)