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

Method test_tell

test/test_grid_file.py:464–478  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

462 g.seek(-100, _SEEK_CUR)
463
464 def test_tell(self):
465 f = GridIn(self.db.fs, chunkSize=3)
466 f.write(b"hello world")
467 f.close()
468
469 g = GridOut(self.db.fs, f._id)
470 self.assertEqual(0, g.tell())
471 g.read(0)
472 self.assertEqual(0, g.tell())
473 g.read(1)
474 self.assertEqual(1, g.tell())
475 g.read(2)
476 self.assertEqual(3, g.tell())
477 g.read()
478 self.assertEqual(g.length, g.tell())
479
480 def test_multiple_reads(self):
481 f = GridIn(self.db.fs, chunkSize=3)

Callers

nothing calls this directly

Calls 6

writeMethod · 0.95
closeMethod · 0.95
tellMethod · 0.95
readMethod · 0.95
GridInClass · 0.90
GridOutClass · 0.90

Tested by

no test coverage detected