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

Function takeJob

main_test.go:225–249  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

223}
224
225func takeJob(t *testing.T) string {
226 req, err := http.NewRequest("GET", config.Current.ServerUrl+"/jobs", nil)
227 assert.NoError(t, err)
228 req.Header.Set("Authorization", "Bearer "+builderKey)
229 resp, err := http.DefaultClient.Do(req)
230 assert.NoError(t, err)
231 assert.NoError(t, util.Check2xxCode(resp.StatusCode))
232
233 var id string
234 reader := tar.NewReader(resp.Body)
235 for {
236 header, err := reader.Next()
237 assert.NoError(t, err)
238 if header.Name == "id.txt" {
239 b, err := ioutil.ReadAll(reader)
240 assert.NoError(t, err)
241 id = string(b)
242 break
243 }
244 }
245 resp, err = http.DefaultClient.Do(req)
246 assert.NoError(t, err)
247 assert.Equal(t, resp.StatusCode, 404)
248 return id
249}
250
251func TestAuthenticationNone(t *testing.T) {
252 resp, err := http.Get(config.Current.ServerUrl + "/jobs")

Callers 1

TestIntegrationFunction · 0.85

Calls 2

Check2xxCodeFunction · 0.92
EqualMethod · 0.80

Tested by

no test coverage detected