def test_clienterror(self): rec = getrec() try: rmm.submit_for_ingest(rec, url + "/goob/?auth=critic", 'bo') self.fail("Failed to raise IngestException") except rmm.IngestClientError as ex: self.assertGreater(ex.status, 400)
def test_unauth(self): rec = getrec() try: rmm.submit_for_ingest(rec, url, 'bo') self.fail("Failed to raise IngestException") except rmm.IngestAuthzError as ex: self.assertEqual(ex.status, 401)
def test_invalid(self): rec = getrec() try: rmm.submit_for_ingest(rec, endpt + "&strictness=abusive", 'bo') self.fail("Failed to raise IngestException") except rmm.NotValidForIngest as ex: self.assertEqual(ex.status, 400) self.assertEqual(len(ex.errors), 4)
def test_servererror(self): try: rec = getrec() stopService() rmm.submit_for_ingest(rec, endpt, 'bo') except rmm.IngestServerError as ex: self.assertIsNone(ex.status) finally: startService()
def test_ok(self): rec = getrec() rmm.submit_for_ingest(rec, endpt, 'bo')
def test_ok(self): rec = getrec() rmm.submit_for_ingest(rec, endpt, 'bo', 'critic', 'header')