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

Method test_removed_dir

Lib/test/test_os/test_os.py:4957–4977  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4955 os.path.join(os.fsencode(self.path),bytes_filename))
4956
4957 def test_removed_dir(self):
4958 path = os.path.join(self.path, 'dir')
4959
4960 os.mkdir(path)
4961 entry = self.get_entry('dir')
4962 os.rmdir(path)
4963
4964 # On POSIX, is_dir() result depends if scandir() filled d_type or not
4965 if os.name == 'nt':
4966 self.assertTrue(entry.is_dir())
4967 self.assertFalse(entry.is_file())
4968 self.assertFalse(entry.is_symlink())
4969 if os.name == 'nt':
4970 self.assertRaises(FileNotFoundError, entry.inode)
4971 # don't fail
4972 entry.stat()
4973 entry.stat(follow_symlinks=False)
4974 else:
4975 self.assertGreater(entry.inode(), 0)
4976 self.assertRaises(FileNotFoundError, entry.stat)
4977 self.assertRaises(FileNotFoundError, entry.stat, follow_symlinks=False)
4978
4979 def test_removed_file(self):
4980 entry = self.create_file_entry()

Callers

nothing calls this directly

Calls 12

get_entryMethod · 0.95
rmdirMethod · 0.80
assertTrueMethod · 0.80
assertFalseMethod · 0.80
assertGreaterMethod · 0.80
joinMethod · 0.45
mkdirMethod · 0.45
is_dirMethod · 0.45
is_fileMethod · 0.45
is_symlinkMethod · 0.45
assertRaisesMethod · 0.45
statMethod · 0.45

Tested by

no test coverage detected