6277: valid manifest must end with new line.
[arvados.git] / sdk / go / arvadosclient / arvadosclient_test.go
index f7d0cc9af72a339b90e96c4c205019e490bf92d0..6a9e13bb27a9d39e8af98e4cc5a22fbd01b29f97 100644 (file)
@@ -86,17 +86,33 @@ func (s *ServerRequiredSuite) TestErrorResponse(c *C) {
                err := arv.Create("logs",
                        Dict{"log": Dict{"bogus_attr": "foo"}},
                        &getback)
+               c.Assert(err, ErrorMatches, "arvados API server error: .*")
                c.Assert(err, ErrorMatches, ".*unknown attribute: bogus_attr.*")
-               c.Assert(err, FitsTypeOf, RemoteApiServerError{})
-               c.Assert(err.(RemoteApiServerError).HttpStatusCode, Equals, 422)
+               c.Assert(err, FitsTypeOf, APIServerError{})
+               c.Assert(err.(APIServerError).HttpStatusCode, Equals, 422)
        }
 
        {
                err := arv.Create("bogus",
                        Dict{"bogus": Dict{}},
                        &getback)
+               c.Assert(err, ErrorMatches, "arvados API server error: .*")
                c.Assert(err, ErrorMatches, ".*Path not found.*")
-               c.Assert(err, FitsTypeOf, RemoteApiServerError{})
-               c.Assert(err.(RemoteApiServerError).HttpStatusCode, Equals, 404)
+               c.Assert(err, FitsTypeOf, APIServerError{})
+               c.Assert(err.(APIServerError).HttpStatusCode, Equals, 404)
        }
 }
+
+func (s *ServerRequiredSuite) TestAPIDiscovery_Get_defaultCollectionReplication(c *C) {
+       arv, err := MakeArvadosClient()
+       value, err := arv.Discovery("defaultCollectionReplication")
+       c.Assert(err, IsNil)
+       c.Assert(value, NotNil)
+}
+
+func (s *ServerRequiredSuite) TestAPIDiscovery_Get_noSuchParameter(c *C) {
+       arv, err := MakeArvadosClient()
+       value, err := arv.Discovery("noSuchParameter")
+       c.Assert(err, NotNil)
+       c.Assert(value, IsNil)
+}