Esempio n. 1
0
func testRequestFromSignedRequest(inst aetest.Instance, sr *SignedRequest) (*http.Request, error) {
	srReq, err := sr.HTTPRequest(nil)
	if err != nil {
		return nil, err
	}
	req, err := inst.NewRequest(srReq.Method, srReq.URL.String(), srReq.Body)
	if err != nil {
		return nil, err
	}
	for k, vals := range srReq.Header {
		req.Header[k] = vals
	}

	return req, nil
}
Esempio n. 2
0
File: common.go Progetto: pubnub/go
func CreateContext(inst aetest.Instance) context.Context {
	r, _ := inst.NewRequest("GET", "/", nil)
	ctx := appengine.NewContext(r)
	return ctx
}