PYTHON-2860 Remove modifiers option from command monitoring spec test (#701)

This commit is contained in:
Shane Harvey 2021-08-10 14:01:47 -07:00 committed by GitHub
parent 4fe2fadc6b
commit 22bbc1ae80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 20 deletions

View File

@ -141,8 +141,8 @@ class Cursor(object):
sort=None, allow_partial_results=False, oplog_replay=False,
modifiers=None, batch_size=0, manipulate=True,
collation=None, hint=None, max_scan=None, max_time_ms=None,
max=None, min=None, return_key=False, show_record_id=False,
snapshot=False, comment=None, session=None,
max=None, min=None, return_key=None, show_record_id=None,
snapshot=None, comment=None, session=None,
allow_disk_use=None):
"""Create a new cursor.
@ -391,12 +391,12 @@ class Cursor(object):
operators["$max"] = self.__max
if self.__min:
operators["$min"] = self.__min
if self.__return_key:
if self.__return_key is not None:
operators["$returnKey"] = self.__return_key
if self.__show_record_id:
if self.__show_record_id is not None:
# This is upgraded to showRecordId for MongoDB 3.2+ "find" command.
operators["$showDiskLoc"] = self.__show_record_id
if self.__snapshot:
if self.__snapshot is not None:
operators["$snapshot"] = self.__snapshot
if operators:

View File

@ -89,21 +89,19 @@
"skip": {
"$numberLong": "2"
},
"modifiers": {
"$comment": "test",
"$hint": {
"_id": 1
},
"$max": {
"_id": 6
},
"$maxTimeMS": 6000,
"$min": {
"_id": 0
},
"$returnKey": false,
"$showDiskLoc": false
}
"comment": "test",
"hint": {
"_id": 1
},
"max": {
"_id": 6
},
"maxTimeMS": 6000,
"min": {
"_id": 0
},
"returnKey": false,
"showRecordId": false
}
},
"expectations": [

View File

@ -109,6 +109,8 @@ def create_test(scenario_def, test):
elif name == 'find':
if 'sort' in args:
args['sort'] = list(args['sort'].items())
if 'hint' in args:
args['hint'] = list(args['hint'].items())
for arg in 'skip', 'limit':
if arg in args:
args[arg] = int(args[arg])