MCPcopy
hub / github.com/iron-io/functions / TestGetTask

Function TestGetTask

api/runner/async_runner_test.go:94–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

92}
93
94func TestGetTask(t *testing.T) {
95 buf := setLogBuffer()
96 mockTask := getMockTask()
97
98 ts := getTestServer([]*models.Task{&mockTask})
99 defer ts.Close()
100
101 url := ts.URL + "/tasks"
102 task, err := getTask(context.Background(), url)
103 if err != nil {
104 t.Log(buf.String())
105 t.Error("expected no error, got", err)
106 }
107 if task.ID != mockTask.ID {
108 t.Log(buf.String())
109 t.Errorf("expected task ID '%s', got '%s'", task.ID, mockTask.ID)
110 }
111}
112
113func TestGetTaskError(t *testing.T) {
114 buf := setLogBuffer()

Callers

nothing calls this directly

Calls 7

getMockTaskFunction · 0.85
getTestServerFunction · 0.85
getTaskFunction · 0.85
CloseMethod · 0.80
setLogBufferFunction · 0.70
LogMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…