~ubuntu-branches/ubuntu/wily/ubuntu-push/wily-proposed

« back to all changes in this revision

Viewing changes to bus/connectivity/webchecker_test.go

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, John R. Lenton
  • Date: 2015-02-09 11:08:02 UTC
  • mfrom: (1.1.22)
  • Revision ID: package-import@ubuntu.com-20150209110802-bqjrq4v480arc1jw
Tags: 0.67+15.04.20150209-0ubuntu1
[ John R. Lenton ]
* Updated precommit script. [dev]

* Include code examples in docs (instead of repeating). [docs]

* Make tests more robust in the face of go 1.3 [client, server]

* Introduce StartClientAuthFlex for acceptance tests: Start a client
  with auth, take a devId regexp, don't check any client event; support
  connbroken in acceptanceclient. [server]

* Cleanup and improve logging, and make log messages more
  consistent. [client]

* Partially work around bug lp:1390663 in a minimally intrusive way
  (real fix will have to wait). [client]

* Add SIGQUIT handler to spit out stack dumps; more logging
  tweaks. [client, server]

* Adds a couple of buttons to exercise more APIs, version bump to
  0.44. [sample app]

* Add APIError to server/acceptance/kit that includes the body for
  debugging. [server]

* Add DisableKeepAlives and MaxIdleConnsPerHost to the APIClient
  SetupClient method. [server]

* Clean up goroutines in tests. [client]

* Add an explicit check and log message for nil error on webcheck's CopyN. [client]

* Log line nums, enabled when logLevel = debug. [client server]

* Workaround gc issue with 1.3 and 32 bits. Fixes FTBFS. [client]

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import (
20
20
        . "launchpad.net/gocheck"
21
 
        "launchpad.net/ubuntu-push/logger"
22
21
        helpers "launchpad.net/ubuntu-push/testing"
23
22
        "launchpad.net/ubuntu-push/util"
24
23
        "net/http"
28
27
 
29
28
type WebcheckerSuite struct {
30
29
        timeouts []time.Duration
31
 
        log      logger.Logger
 
30
        log      *helpers.TestLogger
32
31
}
33
32
 
34
33
var _ = Suite(&WebcheckerSuite{})
104
103
        ch := make(chan bool, 1)
105
104
        ck.Webcheck(ch)
106
105
        c.Check(<-ch, Equals, false)
 
106
        c.Check(s.log.Captured(), Matches, "(?ism).*content mismatch.*")
107
107
}
108
108
 
109
109
// Webchecker sends false if the download is too big
115
115
        ch := make(chan bool, 1)
116
116
        ck.Webcheck(ch)
117
117
        c.Check(<-ch, Equals, false)
 
118
        c.Check(s.log.Captured(), Matches, "(?ism).*larger than 1k.*")
118
119
}
119
120
 
120
121
// Webchecker sends false if the request timeouts