(self)
| 1200 | self.assertFalse(t.is_alive()) |
| 1201 | |
| 1202 | def test_distinct(self): |
| 1203 | self.db.drop_collection("test") |
| 1204 | |
| 1205 | self.db.test.insert_many([{"a": 1}, {"a": 2}, {"a": 2}, {"a": 2}, {"a": 3}]) |
| 1206 | |
| 1207 | distinct = self.db.test.find({"a": {"$lt": 3}}).distinct("a") |
| 1208 | distinct.sort() |
| 1209 | |
| 1210 | self.assertEqual([1, 2], distinct) |
| 1211 | |
| 1212 | self.db.drop_collection("test") |
| 1213 | |
| 1214 | self.db.test.insert_one({"a": {"b": "a"}, "c": 12}) |
| 1215 | self.db.test.insert_one({"a": {"b": "b"}, "c": 8}) |
| 1216 | self.db.test.insert_one({"a": {"b": "c"}, "c": 12}) |
| 1217 | self.db.test.insert_one({"a": {"b": "c"}, "c": 8}) |
| 1218 | |
| 1219 | distinct = self.db.test.find({"c": 8}).distinct("a.b") |
| 1220 | distinct.sort() |
| 1221 | |
| 1222 | self.assertEqual(["b", "c"], distinct) |
| 1223 | |
| 1224 | def test_with_statement(self): |
| 1225 | self.db.drop_collection("test") |
nothing calls this directly
no test coverage detected