PYTHON-2764 Fix unified test coerce_result on unack writes (#652)

(cherry picked from commit 3ef01179a2)
This commit is contained in:
Shane Harvey 2021-06-22 17:25:05 -07:00 committed by Shane Harvey
parent a08ac8581e
commit 9e5ab1b5b9

View File

@ -614,6 +614,8 @@ class MatchEvaluatorUtil(object):
def coerce_result(opname, result):
"""Convert a pymongo result into the spec's result format."""
if hasattr(result, 'acknowledged') and not result.acknowledged:
return {'acknowledged': False}
if opname == 'bulkWrite':
return parse_bulk_write_result(result)
if opname == 'insertOne':