MCPcopy Index your code
hub / github.com/python/cpython / test_telling

Method test_telling

Lib/test/test_io/test_textio.py:579–597  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

577 self.assertEqual(rlines, wlines)
578
579 def test_telling(self):
580 f = self.open(os_helper.TESTFN, "w+", encoding="utf-8")
581 p0 = f.tell()
582 f.write("\xff\n")
583 p1 = f.tell()
584 f.write("\xff\n")
585 p2 = f.tell()
586 f.seek(0)
587 self.assertEqual(f.tell(), p0)
588 self.assertEqual(f.readline(), "\xff\n")
589 self.assertEqual(f.tell(), p1)
590 self.assertEqual(f.readline(), "\xff\n")
591 self.assertEqual(f.tell(), p2)
592 f.seek(0)
593 for line in f:
594 self.assertEqual(line, "\xff\n")
595 self.assertRaises(OSError, f.tell)
596 self.assertEqual(f.tell(), p2)
597 f.close()
598
599 def test_seeking(self):
600 chunk_size = _default_chunk_size()

Callers

nothing calls this directly

Calls 8

openMethod · 0.45
tellMethod · 0.45
writeMethod · 0.45
seekMethod · 0.45
assertEqualMethod · 0.45
readlineMethod · 0.45
assertRaisesMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected