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

Function TestDeleteTask

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

Source from the content-addressed store, hash-verified

145}
146
147func TestDeleteTask(t *testing.T) {
148 buf := setLogBuffer()
149 mockTask := getMockTask()
150
151 ts := getTestServer([]*models.Task{&mockTask})
152 defer ts.Close()
153
154 url := ts.URL + "/tasks"
155 err := deleteTask(url, &mockTask)
156 if err == nil {
157 t.Log(buf.String())
158 t.Error("expected error 'Not reserver', got", err)
159 }
160
161 _, err = getTask(context.Background(), url)
162 if err != nil {
163 t.Log(buf.String())
164 t.Error("expected no error, got", err)
165 }
166
167 err = deleteTask(url, &mockTask)
168 if err != nil {
169 t.Log(buf.String())
170 t.Error("expected no error, got", err)
171 }
172}
173
174func TestTasksrvURL(t *testing.T) {
175 tests := []struct {

Callers

nothing calls this directly

Calls 8

getMockTaskFunction · 0.85
getTestServerFunction · 0.85
deleteTaskFunction · 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…