(self, entry, name, is_dir, is_file, is_symlink)
| 4826 | scandir_iter.close() |
| 4827 | |
| 4828 | def check_entry(self, entry, name, is_dir, is_file, is_symlink): |
| 4829 | self.assertIsInstance(entry, os.DirEntry) |
| 4830 | self.assertEqual(entry.name, name) |
| 4831 | self.assertEqual(entry.path, os.path.join(self.path, name)) |
| 4832 | self.assertEqual(entry.inode(), |
| 4833 | os.stat(entry.path, follow_symlinks=False).st_ino) |
| 4834 | |
| 4835 | entry_stat = os.stat(entry.path) |
| 4836 | self.assertEqual(entry.is_dir(), |
| 4837 | stat.S_ISDIR(entry_stat.st_mode)) |
| 4838 | self.assertEqual(entry.is_file(), |
| 4839 | stat.S_ISREG(entry_stat.st_mode)) |
| 4840 | self.assertEqual(entry.is_symlink(), |
| 4841 | os.path.islink(entry.path)) |
| 4842 | |
| 4843 | entry_lstat = os.stat(entry.path, follow_symlinks=False) |
| 4844 | self.assertEqual(entry.is_dir(follow_symlinks=False), |
| 4845 | stat.S_ISDIR(entry_lstat.st_mode)) |
| 4846 | self.assertEqual(entry.is_file(follow_symlinks=False), |
| 4847 | stat.S_ISREG(entry_lstat.st_mode)) |
| 4848 | |
| 4849 | self.assertEqual(entry.is_junction(), os.path.isjunction(entry.path)) |
| 4850 | |
| 4851 | self.assert_stat_equal(entry.stat(), |
| 4852 | entry_stat, |
| 4853 | os.name == 'nt' and not is_symlink) |
| 4854 | self.assert_stat_equal(entry.stat(follow_symlinks=False), |
| 4855 | entry_lstat, |
| 4856 | os.name == 'nt') |
| 4857 | |
| 4858 | def test_attributes(self): |
| 4859 | link = os_helper.can_hardlink() |
no test coverage detected