Skip to content

Commit

Permalink
assert*() methods introduced in py27 replaced with assertTrue()
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaSkriblovsky committed May 13, 2015
1 parent 127bd84 commit b142fa1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/test_aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def test_Aggregate(self):

res = yield self.coll.aggregate([{"$match": {"oh": "hai"}}], full_response=True)

self.assertIn("ok", res)
self.assertIn("result", res)
self.assertTrue("ok" in res)
self.assertTrue("result" in res)
self.assertEqual(len(res["result"]), 2)

@defer.inlineCallbacks
Expand Down
2 changes: 1 addition & 1 deletion tests/test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def make_col(base, name):
self.assertEqual(self.db.test.test, self.db.test("test"))

options = yield self.db.test.options()
self.assertIsInstance(options, dict)
self.assertTrue(isinstance(options, dict))

yield self.db.drop_collection("test")
collection_names = yield self.db.collection_names()
Expand Down
4 changes: 2 additions & 2 deletions tests/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,12 @@ def test_AsClass(self):
yield self.coll.insert({'x': 42})

doc = yield self.coll.find_one({})
self.assertIs(type(doc), dict)
self.assertTrue(type(doc) is dict)

class CustomDict(dict): pass

doc = yield self.coll.find_one({}, as_class=CustomDict)
self.assertIs(type(doc), CustomDict)
self.assertTrue(type(doc) is CustomDict)

@defer.inlineCallbacks
def tearDown(self):
Expand Down

0 comments on commit b142fa1

Please sign in to comment.