(t *testing.T, returnId string)
| 209 | } |
| 210 | |
| 211 | func uploadSignedFile(t *testing.T, returnId string) { |
| 212 | fileId := tusUpload(t, []byte(signedData)) |
| 213 | form := url.Values{ |
| 214 | "file_id": {fileId}} |
| 215 | req, err := http.NewRequest("POST", |
| 216 | fmt.Sprintf("%s/jobs/%s/signed", config.Current.ServerUrl, returnId), strings.NewReader(form.Encode())) |
| 217 | assert.NoError(t, err) |
| 218 | req.Header.Set("Authorization", "Bearer "+builderKey) |
| 219 | req.Header.Set("Content-Type", "application/x-www-form-urlencoded") |
| 220 | resp, err := http.DefaultClient.Do(req) |
| 221 | assert.NoError(t, err) |
| 222 | assert.NoError(t, util.Check2xxCode(resp.StatusCode)) |
| 223 | } |
| 224 | |
| 225 | func takeJob(t *testing.T) string { |
| 226 | req, err := http.NewRequest("GET", config.Current.ServerUrl+"/jobs", nil) |
no test coverage detected