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

Function run_test

test/test_read_write_concern_spec.py:250–269  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

248
249def create_connection_string_test(test_case):
250 def run_test(self):
251 uri = test_case["uri"]
252 valid = test_case["valid"]
253 warning = test_case["warning"]
254
255 if not valid:
256 if warning is False:
257 self.assertRaises((ConfigurationError, ValueError), MongoClient, uri, connect=False)
258 else:
259 with warnings.catch_warnings():
260 warnings.simplefilter("error", UserWarning)
261 self.assertRaises(UserWarning, MongoClient, uri, connect=False)
262 else:
263 client = MongoClient(uri, connect=False)
264 if "writeConcern" in test_case:
265 document = client.write_concern.document
266 self.assertEqual(document, normalize_write_concern(test_case["writeConcern"]))
267 if "readConcern" in test_case:
268 document = client.read_concern.document
269 self.assertEqual(document, test_case["readConcern"])
270
271 return run_test
272

Callers

nothing calls this directly

Calls 4

MongoClientClass · 0.90
WriteConcernClass · 0.90
ReadConcernClass · 0.90
normalize_write_concernFunction · 0.70

Tested by

no test coverage detected