@@ -1858,25 +1858,15 @@ def test_iterdir_status(self):
18581858        for  child  in  p .iterdir ():
18591859            entry  =  child .status 
18601860            self .assertIsInstance (entry , Status )
1861+             self .assertEqual (entry .exists (), child .exists ())
1862+             self .assertEqual (entry .is_dir (), child .is_dir ())
1863+             self .assertEqual (entry .is_file (), child .is_file ())
1864+             self .assertEqual (entry .is_symlink (), child .is_symlink ())
18611865            self .assertTrue (entry .exists (follow_symlinks = False ))
18621866            self .assertEqual (entry .is_dir (follow_symlinks = False ),
18631867                             child .is_dir (follow_symlinks = False ))
18641868            self .assertEqual (entry .is_file (follow_symlinks = False ),
18651869                             child .is_file (follow_symlinks = False ))
1866-             self .assertEqual (entry .is_symlink (),
1867-                              child .is_symlink ())
1868-             if  child .name  ==  'brokenLink' :
1869-                 self .assertFalse (entry .exists ())
1870-                 self .assertFalse (entry .is_dir ())
1871-                 self .assertFalse (entry .is_file ())
1872-             elif  child .name  ==  'brokenLinkLoop' :
1873-                 self .assertRaises (OSError , entry .exists )
1874-                 self .assertRaises (OSError , entry .is_dir )
1875-                 self .assertRaises (OSError , entry .is_file )
1876-             else :
1877-                 self .assertTrue (entry .exists ())
1878-                 self .assertEqual (entry .is_dir (), child .is_dir ())
1879-                 self .assertEqual (entry .is_file (), child .is_file ())
18801870
18811871    def  test_glob_common (self ):
18821872        def  _check (glob , expected ):
@@ -2018,7 +2008,7 @@ def test_status_exists(self):
20182008            self .assertTrue ((p  /  'linkB' ).status .exists (follow_symlinks = True ))
20192009            self .assertFalse ((p  /  'brokenLink' ).status .exists ())
20202010            self .assertTrue ((p  /  'brokenLink' ).status .exists (follow_symlinks = False ))
2021-             self .assertRaises ( OSError ,  (p  /  'brokenLinkLoop' ).status .exists )
2011+             self .assertFalse ( (p  /  'brokenLinkLoop' ).status .exists () )
20222012            self .assertTrue ((p  /  'brokenLinkLoop' ).status .exists (follow_symlinks = False ))
20232013        self .assertFalse ((p  /  'fileA\udfff ' ).status .exists ())
20242014        self .assertFalse ((p  /  'fileA\udfff ' ).status .exists (follow_symlinks = False ))
@@ -2040,7 +2030,7 @@ def test_status_is_dir(self):
20402030            self .assertFalse ((p  /  'linkB' ).status .is_dir (follow_symlinks = False ))
20412031            self .assertFalse ((p  /  'brokenLink' ).status .is_dir ())
20422032            self .assertFalse ((p  /  'brokenLink' ).status .is_dir (follow_symlinks = False ))
2043-             self .assertRaises ( OSError ,  (p  /  'brokenLinkLoop' ).status .is_dir )
2033+             self .assertFalse ( (p  /  'brokenLinkLoop' ).status .is_dir () )
20442034            self .assertFalse ((p  /  'brokenLinkLoop' ).status .is_dir (follow_symlinks = False ))
20452035        self .assertFalse ((p  /  'dirA\udfff ' ).status .is_dir ())
20462036        self .assertFalse ((p  /  'dirA\udfff ' ).status .is_dir (follow_symlinks = False ))
@@ -2062,7 +2052,7 @@ def test_status_is_file(self):
20622052            self .assertFalse ((p  /  'linkB' ).status .is_file (follow_symlinks = False ))
20632053            self .assertFalse ((p  /  'brokenLink' ).status .is_file ())
20642054            self .assertFalse ((p  /  'brokenLink' ).status .is_file (follow_symlinks = False ))
2065-             self .assertRaises ( OSError ,  (p  /  'brokenLinkLoop' ).status .is_file )
2055+             self .assertFalse ( (p  /  'brokenLinkLoop' ).status .is_file () )
20662056            self .assertFalse ((p  /  'brokenLinkLoop' ).status .is_file (follow_symlinks = False ))
20672057        self .assertFalse ((p  /  'fileA\udfff ' ).status .is_file ())
20682058        self .assertFalse ((p  /  'fileA\udfff ' ).status .is_file (follow_symlinks = False ))
0 commit comments