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

Method test_info_exists

Lib/test/test_pathlib/test_read.py:250–271  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

248 self.assertTrue(seen_root)
249
250 def test_info_exists(self):
251 p = self.root
252 self.assertTrue(p.info.exists())
253 self.assertTrue((p / 'dirA').info.exists())
254 self.assertTrue((p / 'dirA').info.exists(follow_symlinks=False))
255 self.assertTrue((p / 'fileA').info.exists())
256 self.assertTrue((p / 'fileA').info.exists(follow_symlinks=False))
257 self.assertFalse((p / 'non-existing').info.exists())
258 self.assertFalse((p / 'non-existing').info.exists(follow_symlinks=False))
259 if self.ground.can_symlink:
260 self.assertTrue((p / 'linkA').info.exists())
261 self.assertTrue((p / 'linkA').info.exists(follow_symlinks=False))
262 self.assertTrue((p / 'linkB').info.exists())
263 self.assertTrue((p / 'linkB').info.exists(follow_symlinks=True))
264 self.assertFalse((p / 'brokenLink').info.exists())
265 self.assertTrue((p / 'brokenLink').info.exists(follow_symlinks=False))
266 self.assertFalse((p / 'brokenLinkLoop').info.exists())
267 self.assertTrue((p / 'brokenLinkLoop').info.exists(follow_symlinks=False))
268 self.assertFalse((p / 'fileA\udfff').info.exists())
269 self.assertFalse((p / 'fileA\udfff').info.exists(follow_symlinks=False))
270 self.assertFalse((p / 'fileA\x00').info.exists())
271 self.assertFalse((p / 'fileA\x00').info.exists(follow_symlinks=False))
272
273 def test_info_is_dir(self):
274 p = self.root

Callers

nothing calls this directly

Calls 3

assertTrueMethod · 0.80
assertFalseMethod · 0.80
existsMethod · 0.45

Tested by

no test coverage detected