MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_not_primary_error

Method test_not_primary_error

test/test_errors.py:33–39  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

31
32class TestErrors(PyMongoTestCase):
33 def test_not_primary_error(self):
34 exc = NotPrimaryError("not primary test", {"errmsg": "error"})
35 self.assertIn("full error", str(exc))
36 try:
37 raise exc
38 except NotPrimaryError:
39 self.assertIn("full error", traceback.format_exc())
40
41 def test_operation_failure(self):
42 exc = OperationFailure("operation failure test", 10, {"errmsg": "error"})

Callers

nothing calls this directly

Calls 1

NotPrimaryErrorClass · 0.90

Tested by

no test coverage detected