X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b805211887332f43b42c74f52f2b43686546003d..d9c9f862f9bec00285d39dd64d2b677af9aabe92:/lib/controller/router/router_test.go diff --git a/lib/controller/router/router_test.go b/lib/controller/router/router_test.go index 7228956453..ce440dac57 100644 --- a/lib/controller/router/router_test.go +++ b/lib/controller/router/router_test.go @@ -379,6 +379,7 @@ func (s *RouterIntegrationSuite) TestFullTimestampsInResponse(c *check.C) { func (s *RouterIntegrationSuite) TestSelectParam(c *check.C) { uuid := arvadostest.QueuedContainerUUID token := arvadostest.ActiveTokenV2 + // GET for _, sel := range [][]string{ {"uuid", "command"}, {"uuid", "command", "uuid"}, @@ -395,6 +396,26 @@ func (s *RouterIntegrationSuite) TestSelectParam(c *check.C) { _, hasMounts := resp["mounts"] c.Check(hasMounts, check.Equals, false) } + // POST & PUT + uuid = arvadostest.FooCollection + j, err := json.Marshal([]string{"uuid", "description"}) + c.Assert(err, check.IsNil) + for _, method := range []string{"PUT", "POST"} { + desc := "Today is " + time.Now().String() + reqBody := "{\"description\":\"" + desc + "\"}" + var resp map[string]interface{} + var rr *httptest.ResponseRecorder + if method == "PUT" { + _, rr, resp = doRequest(c, s.rtr, token, method, "/arvados/v1/collections/"+uuid+"?select="+string(j), nil, bytes.NewReader([]byte(reqBody))) + } else { + _, rr, resp = doRequest(c, s.rtr, token, method, "/arvados/v1/collections?select="+string(j), nil, bytes.NewReader([]byte(reqBody))) + } + c.Check(rr.Code, check.Equals, http.StatusOK) + c.Check(resp["kind"], check.Equals, "arvados#collection") + c.Check(resp["uuid"], check.HasLen, 27) + c.Check(resp["description"], check.Equals, desc) + c.Check(resp["manifest_text"], check.IsNil) + } } func (s *RouterIntegrationSuite) TestHEAD(c *check.C) {