MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/golang-samples / TestCreateHTTPTask

Function TestCreateHTTPTask

tasks/create_http_task_test.go:23–49  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21)
22
23func TestCreateHTTPTask(t *testing.T) {
24 tc := testutil.SystemTest(t)
25 locationID := "us-central1"
26 queueID := "my-queue"
27 url := "https://example.com/task_handler"
28
29 tests := []struct {
30 name string
31 message string
32 }{
33 {
34 name: "Message",
35 message: "task details for handler processing",
36 },
37 {
38 name: "No Message",
39 message: "",
40 },
41 }
42
43 for _, test := range tests {
44 _, err := createHTTPTask(tc.ProjectID, locationID, queueID, url, test.message)
45 if err != nil {
46 t.Errorf("CreateTask(%s): %v", test.name, err)
47 }
48 }
49}

Callers

nothing calls this directly

Calls 3

SystemTestFunction · 0.92
createHTTPTaskFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected