(self)
| 187 | self.assertIn(self.db.test.mike, {self.db["test.mike"]}) |
| 188 | |
| 189 | def test_create(self): |
| 190 | # No Exception. |
| 191 | db = client_context.client.pymongo_test |
| 192 | db.create_test_no_wc.drop() |
| 193 | |
| 194 | def lambda_test(): |
| 195 | return "create_test_no_wc" not in db.list_collection_names() |
| 196 | |
| 197 | def lambda_test_2(): |
| 198 | return "create_test_no_wc" in db.list_collection_names() |
| 199 | |
| 200 | wait_until( |
| 201 | lambda_test, |
| 202 | "drop create_test_no_wc collection", |
| 203 | ) |
| 204 | db.create_collection("create_test_no_wc") |
| 205 | wait_until( |
| 206 | lambda_test_2, |
| 207 | "create create_test_no_wc collection", |
| 208 | ) |
| 209 | # SERVER-33317 |
| 210 | if not client_context.is_mongos or not client_context.version.at_least(3, 7, 0): |
| 211 | with self.assertRaises(OperationFailure): |
| 212 | db.create_collection("create-test-wc", write_concern=IMPOSSIBLE_WRITE_CONCERN) |
| 213 | |
| 214 | def test_drop_nonexistent_collection(self): |
| 215 | self.db.drop_collection("test") |
nothing calls this directly
no test coverage detected