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

Method test_removed_dir

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

Source from the content-addressed store, hash-verified

5231 os.path.join(os.fsencode(self.path),bytes_filename))
5232
5233 def test_removed_dir(self):
5234 path = os.path.join(self.path, 'dir')
5235
5236 os.mkdir(path)
5237 entry = self.get_entry('dir')
5238 os.rmdir(path)
5239
5240 # On POSIX, is_dir() result depends if scandir() filled d_type or not
5241 if os.name == 'nt':
5242 self.assertTrue(entry.is_dir())
5243 self.assertFalse(entry.is_file())
5244 self.assertFalse(entry.is_symlink())
5245 if os.name == 'nt':
5246 self.assertRaises(FileNotFoundError, entry.inode)
5247 # don't fail
5248 entry.stat()
5249 entry.stat(follow_symlinks=False)
5250 else:
5251 self.assertGreater(entry.inode(), 0)
5252 self.assertRaises(FileNotFoundError, entry.stat)
5253 self.assertRaises(FileNotFoundError, entry.stat, follow_symlinks=False)
5254
5255 def test_removed_file(self):
5256 entry = self.create_file_entry()

Callers

nothing calls this directly

Calls 13

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

Tested by

no test coverage detected