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

« back to all changes in this revision

Viewing changes to src/github.com/juju/httprequest/client_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:
104
104
                P: "hello",
105
105
        },
106
106
        expectResp: &chM1Resp{"hello"},
 
107
}, {
 
108
        about:       "bad content in successful response",
 
109
        req:         &chM4Req{},
 
110
        expectResp:  new(int),
 
111
        expectError: `GET http://.*/m4: unexpected content type text/plain; want application/json; content: bad response`,
107
112
}}
108
113
 
109
114
func (s *clientSuite) TestCall(c *gc.C) {
542
547
        return errgo.New("m3 error")
543
548
}
544
549
 
 
550
type chM4Req struct {
 
551
        httprequest.Route `httprequest:"GET /m4"`
 
552
}
 
553
 
 
554
func (clientHandlers) M4(p httprequest.Params, _ *chM4Req) {
 
555
        p.Response.Write([]byte("bad response"))
 
556
}
 
557
 
545
558
type chContentLengthReq struct {
546
559
        httprequest.Route `httprequest:"PUT /content-length"`
547
560
}