(self, entry, name, is_dir, is_file, is_symlink)
| 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): |
no test coverage detected