Beispiel #1
0
 def test_rest_exception(self):
     """Raise and inspect a MarklogicServerError"""
     client = RESTClient.from_envvar('MLLIB_TEST_SERVER')
     with self.assertRaises(MarkLogicServerError) as ctxt:
         client.rest_get('/v1/documents', params={'uri': 'nonexistent.xml'})
     exc = ctxt.exception
     self.assertEqual(exc.http_code, 404)
     self.assertEqual(exc.mlcode, 'RESTAPI-NODOCUMENT')
 def test_rest_exception(self):
     """Raise and inspect a MarklogicServerError"""
     client = RESTClient.from_envvar('MLLIB_TEST_SERVER')
     with self.assertRaises(MarkLogicServerError) as ctxt:
         client.rest_get('/v1/documents', params={'uri': 'nonexistent.xml'})
     exc = ctxt.exception
     self.assertEqual(exc.http_code, 404)
     self.assertEqual(exc.mlcode, 'RESTAPI-NODOCUMENT')
 def setUpClass(cls):
     cls.client = RESTClient.from_envvar('MLLIB_TEST_SERVER')
 def setUpClass(cls):
     cls.client = RESTClient('httpbin.org', 80, 'schtroumpf', 'schtroumpf')
Beispiel #5
0
 def setUpClass(cls):
     cls.client = RESTClient.from_envvar('MLLIB_TEST_SERVER')