MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_info_exists

Method test_info_exists

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

Source from the content-addressed store, hash-verified

242 self.assertTrue(seen_root)
243
244 def test_info_exists(self):
245 p = self.root
246 self.assertTrue(p.info.exists())
247 self.assertTrue((p / 'dirA').info.exists())
248 self.assertTrue((p / 'dirA').info.exists(follow_symlinks=False))
249 self.assertTrue((p / 'fileA').info.exists())
250 self.assertTrue((p / 'fileA').info.exists(follow_symlinks=False))
251 self.assertFalse((p / 'non-existing').info.exists())
252 self.assertFalse((p / 'non-existing').info.exists(follow_symlinks=False))
253 if self.ground.can_symlink:
254 self.assertTrue((p / 'linkA').info.exists())
255 self.assertTrue((p / 'linkA').info.exists(follow_symlinks=False))
256 self.assertTrue((p / 'linkB').info.exists())
257 self.assertTrue((p / 'linkB').info.exists(follow_symlinks=True))
258 self.assertFalse((p / 'brokenLink').info.exists())
259 self.assertTrue((p / 'brokenLink').info.exists(follow_symlinks=False))
260 self.assertFalse((p / 'brokenLinkLoop').info.exists())
261 self.assertTrue((p / 'brokenLinkLoop').info.exists(follow_symlinks=False))
262 self.assertFalse((p / 'fileA\udfff').info.exists())
263 self.assertFalse((p / 'fileA\udfff').info.exists(follow_symlinks=False))
264 self.assertFalse((p / 'fileA\x00').info.exists())
265 self.assertFalse((p / 'fileA\x00').info.exists(follow_symlinks=False))
266
267 def test_info_is_dir(self):
268 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