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

Method check_entry

Lib/test/test_os.py:5103–5131  ·  view source on GitHub ↗
(self, entry, name, is_dir, is_file, is_symlink)

Source from the content-addressed store, hash-verified

5101 scandir_iter.close()
5102
5103 def check_entry(self, entry, name, is_dir, is_file, is_symlink):
5104 self.assertIsInstance(entry, os.DirEntry)
5105 self.assertEqual(entry.name, name)
5106 self.assertEqual(entry.path, os.path.join(self.path, name))
5107 self.assertEqual(entry.inode(),
5108 os.stat(entry.path, follow_symlinks=False).st_ino)
5109
5110 entry_stat = os.stat(entry.path)
5111 self.assertEqual(entry.is_dir(),
5112 stat.S_ISDIR(entry_stat.st_mode))
5113 self.assertEqual(entry.is_file(),
5114 stat.S_ISREG(entry_stat.st_mode))
5115 self.assertEqual(entry.is_symlink(),
5116 os.path.islink(entry.path))
5117
5118 entry_lstat = os.stat(entry.path, follow_symlinks=False)
5119 self.assertEqual(entry.is_dir(follow_symlinks=False),
5120 stat.S_ISDIR(entry_lstat.st_mode))
5121 self.assertEqual(entry.is_file(follow_symlinks=False),
5122 stat.S_ISREG(entry_lstat.st_mode))
5123
5124 self.assertEqual(entry.is_junction(), os.path.isjunction(entry.path))
5125
5126 self.assert_stat_equal(entry.stat(),
5127 entry_stat,
5128 os.name == 'nt' and not is_symlink)
5129 self.assert_stat_equal(entry.stat(follow_symlinks=False),
5130 entry_lstat,
5131 os.name == 'nt')
5132
5133 @unittest.skipIf(sys.platform == "linux", "TODO: RUSTPYTHON; flaky test")
5134 def test_attributes(self):

Callers 1

test_attributesMethod · 0.95

Calls 11

assert_stat_equalMethod · 0.95
assertIsInstanceMethod · 0.80
inodeMethod · 0.80
islinkMethod · 0.80
assertEqualMethod · 0.45
joinMethod · 0.45
statMethod · 0.45
is_dirMethod · 0.45
is_fileMethod · 0.45
is_symlinkMethod · 0.45
is_junctionMethod · 0.45

Tested by

no test coverage detected