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

Method test_pathlike_file

Lib/test/test_fileinput.py:480–487  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

478 self.assertEqual(src.linesread, [])
479
480 def test_pathlike_file(self):
481 t1 = FakePath(self.writeTmp("Path-like file."))
482 with FileInput(t1, encoding="utf-8") as fi:
483 line = fi.readline()
484 self.assertEqual(line, 'Path-like file.')
485 self.assertEqual(fi.lineno(), 1)
486 self.assertEqual(fi.filelineno(), 1)
487 self.assertEqual(fi.filename(), os.fspath(t1))
488
489 def test_pathlike_file_inplace(self):
490 t1 = FakePath(self.writeTmp('Path-like file.'))

Callers

nothing calls this directly

Calls 8

FakePathClass · 0.90
FileInputClass · 0.90
writeTmpMethod · 0.80
readlineMethod · 0.45
assertEqualMethod · 0.45
linenoMethod · 0.45
filelinenoMethod · 0.45
filenameMethod · 0.45

Tested by

no test coverage detected