(self)
| 139 | okay.join() |
| 140 | |
| 141 | def test_safe_update(self): |
| 142 | self.db.drop_collection("test1") |
| 143 | self.db.test1.insert_one({"test": "update"}) |
| 144 | self.db.test1.insert_one({"test": "unique"}) |
| 145 | self.db.drop_collection("test2") |
| 146 | self.db.test2.insert_one({"test": "update"}) |
| 147 | self.db.test2.insert_one({"test": "unique"}) |
| 148 | |
| 149 | self.db.test2.create_index("test", unique=True) |
| 150 | self.db.test2.find_one() |
| 151 | |
| 152 | okay = Update(self.db.test1, 2000, False) |
| 153 | error = Update(self.db.test2, 2000, True) |
| 154 | |
| 155 | error.start() |
| 156 | okay.start() |
| 157 | |
| 158 | error.join() |
| 159 | okay.join() |
| 160 | |
| 161 | |
| 162 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected