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

Method test_removed_file

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

Source from the content-addressed store, hash-verified

5253 self.assertRaises(FileNotFoundError, entry.stat, follow_symlinks=False)
5254
5255 def test_removed_file(self):
5256 entry = self.create_file_entry()
5257 os.unlink(entry.path)
5258
5259 self.assertFalse(entry.is_dir())
5260 # On POSIX, is_dir() result depends if scandir() filled d_type or not
5261 if os.name == 'nt':
5262 self.assertTrue(entry.is_file())
5263 self.assertFalse(entry.is_symlink())
5264 if os.name == 'nt':
5265 self.assertRaises(FileNotFoundError, entry.inode)
5266 # don't fail
5267 entry.stat()
5268 entry.stat(follow_symlinks=False)
5269 else:
5270 self.assertGreater(entry.inode(), 0)
5271 self.assertRaises(FileNotFoundError, entry.stat)
5272 self.assertRaises(FileNotFoundError, entry.stat, follow_symlinks=False)
5273
5274 def test_broken_symlink(self):
5275 if not os_helper.can_symlink():

Callers

nothing calls this directly

Calls 11

create_file_entryMethod · 0.95
assertFalseMethod · 0.80
assertTrueMethod · 0.80
assertGreaterMethod · 0.80
inodeMethod · 0.80
unlinkMethod · 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