MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_safe_update

Method test_safe_update

test/test_threads.py:141–159  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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
162if __name__ == "__main__":

Callers

nothing calls this directly

Calls 7

UpdateClass · 0.85
drop_collectionMethod · 0.45
insert_oneMethod · 0.45
create_indexMethod · 0.45
find_oneMethod · 0.45
startMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected