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

Method test_threaded_writes

test/test_gridfs.py:236–248  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

234 self.assertEqual(100 * [b"hello"], results)
235
236 def test_threaded_writes(self):
237 tasks = []
238 for i in range(10):
239 tasks.append(JustWrite(self.fs, 10))
240 tasks[i].start()
241
242 joinall(tasks)
243
244 f = self.fs.get_last_version("test")
245 self.assertEqual(f.read(), b"hello")
246
247 # Should have created 100 versions of 'test' file
248 self.assertEqual(100, self.db.fs.files.count_documents({"filename": "test"}))
249
250 def test_get_last_version(self):
251 one = self.fs.put(b"foo", filename="test")

Callers

nothing calls this directly

Calls 6

joinallFunction · 0.90
JustWriteClass · 0.70
startMethod · 0.45
get_last_versionMethod · 0.45
readMethod · 0.45
count_documentsMethod · 0.45

Tested by

no test coverage detected