Skip to content

Commit

Permalink
Fix $comment tests for MongoDB 3.1.x.
Browse files Browse the repository at this point in the history
  • Loading branch information
behackett committed Jul 14, 2015
1 parent 77de378 commit 39c41b2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/test_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,9 +1052,12 @@ def find():

run_with_profiling(find)

# MongoDB 3.1.5 changed the ns for commands.
regex = {'$regex': 'pymongo_test.(\$cmd|test)'}

def count():
self.db.test.find().comment('foo').count()
op = self.db.system.profile.find({'ns': 'pymongo_test.$cmd',
op = self.db.system.profile.find({'ns': regex,
'op': 'command',
'command.count': 'test',
'command.$comment': 'foo'})
Expand All @@ -1064,7 +1067,7 @@ def count():

def distinct():
self.db.test.find().comment('foo').distinct('type')
op = self.db.system.profile.find({'ns': 'pymongo_test.$cmd',
op = self.db.system.profile.find({'ns': regex,
'op': 'command',
'command.distinct': 'test',
'command.$comment': 'foo'})
Expand Down

0 comments on commit 39c41b2

Please sign in to comment.