MCPcopy Create free account
hub / github.com/golang/appengine / TestRunningVariadic

Function TestRunningVariadic

delay/delay_test.go:276–304  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

274}
275
276func TestRunningVariadic(t *testing.T) {
277 c := newFakeContext()
278
279 // Fake out the adding of a task.
280 var task *taskqueue.Task
281 taskqueueAdder = func(_ context.Context, tk *taskqueue.Task, queue string) (*taskqueue.Task, error) {
282 if queue != "" {
283 t.Errorf(`Got queue %q, expected ""`, queue)
284 }
285 task = tk
286 return tk, nil
287 }
288
289 varFuncMsg = "" // reset state
290 varFunc.Call(c.ctx, "Amiga %d has %d KB RAM", 500, 512)
291
292 // Simulate the Task Queue service.
293 req, err := http.NewRequest("POST", path, bytes.NewBuffer(task.Payload))
294 if err != nil {
295 t.Fatalf("Failed making http.Request: %v", err)
296 }
297 rw := httptest.NewRecorder()
298 runFunc(c.ctx, rw, req)
299
300 const expected = "Amiga 500 has 512 KB RAM"
301 if varFuncMsg != expected {
302 t.Errorf("varFuncMsg = %q, want %q", varFuncMsg, expected)
303 }
304}
305
306func TestErrorFunction(t *testing.T) {
307 c := newFakeContext()

Callers

nothing calls this directly

Calls 4

newFakeContextFunction · 0.70
runFuncFunction · 0.70
NewRequestMethod · 0.65
CallMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…