(t *testing.T)
| 92 | } |
| 93 | |
| 94 | func 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 | |
| 113 | func TestGetTaskError(t *testing.T) { |
| 114 | buf := setLogBuffer() |
nothing calls this directly
no test coverage detected
searching dependent graphs…