MCPcopy Index your code
hub / github.com/SignTools/SignTools / uploadSignedFile

Function uploadSignedFile

main_test.go:211–223  ·  view source on GitHub ↗
(t *testing.T, returnId string)

Source from the content-addressed store, hash-verified

209}
210
211func 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
225func takeJob(t *testing.T) string {
226 req, err := http.NewRequest("GET", config.Current.ServerUrl+"/jobs", nil)

Callers 1

TestIntegrationFunction · 0.85

Calls 2

Check2xxCodeFunction · 0.92
tusUploadFunction · 0.85

Tested by

no test coverage detected