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

Method helper

test/test_grid_file.py:417–433  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

writeMethod · 0.95
closeMethod · 0.95
readMethod · 0.95
GridInClass · 0.90
GridOutClass · 0.90
count_documentsMethod · 0.45

Tested by

no test coverage detected