Skip to content

Commit

Permalink
Merge pull request #151 from IlyaSkriblovsky/fixed-tests-on-3.2
Browse files Browse the repository at this point in the history
Fixed unacknowledged insert_many tests on MongoDB 3.2
  • Loading branch information
psi29a committed Apr 12, 2016
2 parents a22f717 + f8fd024 commit 38bc8a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,15 +623,15 @@ def test_Unacknowledged(self):

@defer.inlineCallbacks
def test_OrderedAck(self):
docs = [{'x': 1}, {'x': 2, '$': "error"}, {'x': 3}]
docs = [{"_id": 1}, {"_id": 1, }, {"_id": 2}]
yield self.assertFailure(self.coll.insert_many(docs), BulkWriteError)

count = yield self.coll.count()
self.assertEqual(count, 1)

@defer.inlineCallbacks
def test_OrderedUnack(self):
docs = [{'x': 1}, {'x': 2, '$': "error"}, {'x': 3}]
docs = [{"_id": 1}, {"_id": 1, }, {"_id": 2}]
coll = self.coll.with_options(write_concern=WriteConcern(w=0))
yield coll.insert_many(docs)

Expand All @@ -640,15 +640,15 @@ def test_OrderedUnack(self):

@defer.inlineCallbacks
def test_Unordered(self):
docs = [{'x': 1}, {'x': 2, '$': "error"}, {'x': 3}]
docs = [{"_id": 1}, {"_id": 1, }, {"_id": 2}]
yield self.assertFailure(self.coll.insert_many(docs, ordered=False), BulkWriteError)

count = yield self.coll.count()
self.assertEqual(count, 2)

@defer.inlineCallbacks
def test_UnorderedUnack(self):
docs = [{'x': 1}, {'x': 2, '$': "error"}, {'x': 3}]
docs = [{"_id": 1}, {"_id": 1, }, {"_id": 2}]
coll = self.coll.with_options(write_concern=WriteConcern(w=0))
yield coll.insert_many(docs, ordered=False)

Expand Down

0 comments on commit 38bc8a7

Please sign in to comment.