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

Method helper

test/asynchronous/test_grid_file.py:419–435  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

417 self.chunks = 0
418
419 async def helper(data):
420 f = AsyncGridIn(self.db.fs, chunkSize=1)
421 await f.write(data)
422 await f.close()
423
424 self.files += 1
425 self.chunks += len(data)
426
427 self.assertEqual(self.files, await self.db.fs.files.count_documents({}))
428 self.assertEqual(self.chunks, await self.db.fs.chunks.count_documents({}))
429
430 g = AsyncGridOut(self.db.fs, f._id)
431 self.assertEqual(data, await g.read())
432
433 g = AsyncGridOut(self.db.fs, f._id)
434 self.assertEqual(data, await g.read(10) + await g.read(10))
435 return True
436
437 await qcheck.check_unittest(self, helper, qcheck.gen_string(qcheck.gen_range(0, 20)))
438

Callers

nothing calls this directly

Calls 6

writeMethod · 0.95
closeMethod · 0.95
readMethod · 0.95
AsyncGridInClass · 0.90
AsyncGridOutClass · 0.90
count_documentsMethod · 0.45

Tested by

no test coverage detected