req := httptest.NewRequest("GET", "/arvados/v1/workflows/"+arvadostest.WorkflowWithDefinitionYAMLUUID, nil)
resp := s.testRequest(req).Result()
c.Check(resp.StatusCode, check.Equals, http.StatusUnauthorized)
- s.checkJSONErrorMatches(c, resp, `Not logged in`)
+ s.checkJSONErrorMatches(c, resp, `Not logged in.*`)
}
func (s *FederationSuite) TestBadAuth(c *check.C) {
req.Header.Set("Authorization", "Bearer aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
resp := s.testRequest(req).Result()
c.Check(resp.StatusCode, check.Equals, http.StatusUnauthorized)
- s.checkJSONErrorMatches(c, resp, `Not logged in`)
+ s.checkJSONErrorMatches(c, resp, `Not logged in.*`)
}
func (s *FederationSuite) TestNoAccess(c *check.C) {
req.Header.Set("Authorization", "Bearer "+arvadostest.SpectatorToken)
resp := s.testRequest(req).Result()
c.Check(resp.StatusCode, check.Equals, http.StatusNotFound)
- s.checkJSONErrorMatches(c, resp, `.*not found`)
+ s.checkJSONErrorMatches(c, resp, `.*not found.*`)
}
func (s *FederationSuite) TestGetUnknownRemote(c *check.C) {
}
func (s *FederationSuite) TestWorkflowCRUD(c *check.C) {
- wf := arvados.Workflow{
- Description: "TestCRUD",
- }
+ var wf arvados.Workflow
{
- body := &strings.Builder{}
- json.NewEncoder(body).Encode(&wf)
req := httptest.NewRequest("POST", "/arvados/v1/workflows", strings.NewReader(url.Values{
- "workflow": {body.String()},
+ "workflow": {`{"description": "TestCRUD"}`},
}.Encode()))
req.Header.Set("Content-type", "application/x-www-form-urlencoded")
req.Header.Set("Authorization", "Bearer "+arvadostest.ActiveToken)