Esempio n. 1
0
func (s *requestSuite) TestNewRequestSuccess(c *gc.C) {
	baseURL, err := url.Parse("https://localhost:8080/")
	c.Assert(err, jc.ErrorIsNil)
	uuid := "abcd-efedcb-012345-6789"
	tag := "machine-0"
	pw := "secure"
	req, err := apihttp.NewRequest("GET", baseURL, "somefacade", uuid, tag, pw)
	c.Assert(err, jc.ErrorIsNil)

	apihttptesting.CheckRequest(c, req, "GET", tag, pw, "localhost", "somefacade")
}
Esempio n. 2
0
// CheckRequest verifies that the HTTP request matches the args
// as an API request should.  We only check API-related request fields.
func (s *HTTPSuite) CheckRequest(c *gc.C, req *http.Request, method, path string) {
	apihttptesting.CheckRequest(c, req, method, s.Username, s.Password, s.Hostname, path)
}