~chipaca/ubuntu-push/conflag-maybe

« back to all changes in this revision

Viewing changes to bus/connectivity/connectivity_test.go

  • Committer: Tarmac
  • Author(s): john.lenton at canonical
  • Date: 2014-01-27 14:09:03 UTC
  • mfrom: (18.4.2 bus-reorg)
  • Revision ID: tarmac-20140127140903-9fntl0xfzxdm2puj
[r=pedronis] moved a bunch of packages under bus/

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import (
20
20
        "io/ioutil"
21
21
        . "launchpad.net/gocheck"
 
22
        "launchpad.net/ubuntu-push/bus/networkmanager"
22
23
        testingbus "launchpad.net/ubuntu-push/bus/testing"
23
24
        "launchpad.net/ubuntu-push/config"
24
25
        "launchpad.net/ubuntu-push/logger"
25
 
        "launchpad.net/ubuntu-push/networkmanager"
26
26
        "launchpad.net/ubuntu-push/testing/condition"
27
 
        "net/http"
28
27
        "net/http/httptest"
29
28
        "testing"
30
29
        "time"
201
200
   tests for ConnectedState()
202
201
*/
203
202
 
204
 
// Todo: get rid of duplication between this and webchecker_test
205
 
const (
206
 
        staticText = "something ipsum dolor something"
207
 
        staticHash = "6155f83b471583f47c99998a472a178f"
208
 
)
209
 
 
210
 
// mkHandler makes an http.HandlerFunc that returns the provided text
211
 
// for whatever request it's given.
212
 
func mkHandler(text string) http.HandlerFunc {
213
 
        return func(w http.ResponseWriter, r *http.Request) {
214
 
                w.(http.Flusher).Flush()
215
 
                w.Write([]byte(text))
216
 
                w.(http.Flusher).Flush()
217
 
        }
218
 
}
219
 
 
220
 
// :oboT
221
 
 
222
203
// yes, this is an integration test
223
204
func (s *ConnSuite) TestRun(c *C) {
224
205
        ts := httptest.NewServer(mkHandler(staticText))