(self, spec)
| 1434 | self.match_evaluator.match_result(expected_msg, actual_msg) |
| 1435 | |
| 1436 | def verify_outcome(self, spec): |
| 1437 | for collection_data in spec: |
| 1438 | coll_name = collection_data["collectionName"] |
| 1439 | db_name = collection_data["databaseName"] |
| 1440 | expected_documents = collection_data["documents"] |
| 1441 | |
| 1442 | coll = self.client.get_database(db_name).get_collection( |
| 1443 | coll_name, |
| 1444 | read_preference=ReadPreference.PRIMARY, |
| 1445 | read_concern=ReadConcern(level="local"), |
| 1446 | ) |
| 1447 | |
| 1448 | if expected_documents is not None: |
| 1449 | sorted_expected_documents = sorted(expected_documents, key=lambda doc: doc["_id"]) |
| 1450 | actual_documents = coll.find({}, sort=[("_id", ASCENDING)]).to_list() |
| 1451 | self.assertListEqual(sorted_expected_documents, actual_documents) |
| 1452 | |
| 1453 | def run_scenario(self, spec, uri=None): |
| 1454 | # Handle flaky tests. |
no test coverage detected