You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by to...@apache.org on 2017/11/13 22:51:23 UTC
[couchdb] 01/02: change assert to assertEqual
This is an automated email from the ASF dual-hosted git repository.
tonysun83 pushed a commit to branch fix-explicit-exists-operator
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 6b909ca2f8e695925597bfe6ed7b35a81ce090d3
Author: Tony Sun <to...@gmail.com>
AuthorDate: Mon Nov 13 10:45:34 2017 -0800
change assert to assertEqual
---
src/mango/test/07-text-custom-field-list-test.py | 26 ++++++++++++------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/mango/test/07-text-custom-field-list-test.py b/src/mango/test/07-text-custom-field-list-test.py
index 921ae45..6229097 100644
--- a/src/mango/test/07-text-custom-field-list-test.py
+++ b/src/mango/test/07-text-custom-field-list-test.py
@@ -174,39 +174,39 @@ class CustomFieldsExistsTest(mango.UserDocsTextTests):
def test_exists_field(self):
docs = self.db.find({"exists_field": {"$exists": True}})
- assert len(docs) == 2
+ self.assertEqual(len(docs), 2)
for d in docs:
- assert d["user_id"] in (7, 8)
+ self.assertIn(d["user_id"] in (7, 8))
docs = self.db.find({"exists_field": {"$exists": False}})
- assert len(docs) == len(user_docs.DOCS) - 2
+ self.assertEqual(len(docs), len(user_docs.DOCS) - 2)
for d in docs:
- assert d["user_id"] not in (7, 8)
+ self.assertNotIn(d["user_id"], (7, 8))
def test_exists_array(self):
docs = self.db.find({"exists_array": {"$exists": True}})
- assert len(docs) == 2
+ self.assertEqual(len(docs), 2)
for d in docs:
- assert d["user_id"] in (9, 10)
+ self.assertIn(d["user_id"], (9, 10))
docs = self.db.find({"exists_array": {"$exists": False}})
- assert len(docs) == len(user_docs.DOCS) - 2
+ self.assertEqual(len(docs), len(user_docs.DOCS) - 2)
for d in docs:
- assert d["user_id"] not in (9, 10)
+ self.assertNotIn(d["user_id"], (9, 10))
def test_exists_object_member(self):
docs = self.db.find({"exists_object.should": {"$exists": True}})
- assert len(docs) == 1
- assert docs[0]["user_id"] == 11
+ self.assertEqual(len(docs), 1)
+ self.assertEqual(docs[0]["user_id"], 11)
docs = self.db.find({"exists_object.should": {"$exists": False}})
- assert len(docs) == len(user_docs.DOCS) - 1
+ self.assertEqual(len(docs), len(user_docs.DOCS) - 1)
for d in docs:
- assert d["user_id"] != 11
+ self.assertNotEqual(d["user_id"], 11)
def test_exists_false_same_as_views(self):
docs = self.db.find({
"twitter": {"$exists": False}
})
for d in docs:
- assert d["user_id"] not in (0, 1, 4, 13)
+ self.assertNotIn(d["user_id"], (0, 1, 4, 13))
--
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <co...@couchdb.apache.org>.