示例#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
}
示例#2
0
文件: common.go 项目: pubnub/go
func CreateContext(inst aetest.Instance) context.Context {
	r, _ := inst.NewRequest("GET", "/", nil)
	ctx := appengine.NewContext(r)
	return ctx
}