@@ -858,7 +858,8 @@ def check(path, mode, expected, errno=None):
858858 path = path .replace ('/' , '\\ ' )
859859 if isinstance (expected , str ):
860860 assert errno is None
861- self .assertEqual (realpath (path , strict = mode ), ABSTFN + expected .replace ('/' , '\\ ' ))
861+ self .assertEqual (realpath (path , strict = mode ),
862+ ABSTFN + expected .replace ('/' , '\\ ' ))
862863 else :
863864 with self .assertRaises (expected ) as cm :
864865 realpath (path , strict = mode )
@@ -870,14 +871,14 @@ def check(path, mode, expected, errno=None):
870871 check ("file" , ALL_BUT_LAST , "/file" )
871872 check ("file" , True , "/file" )
872873 check ("file/" , False , "/file" )
873- # check("file/", ALL_BUT_LAST, NotADirectoryError )
874- # check("file/", True, NotADirectoryError )
874+ check ("file/" , ALL_BUT_LAST , "/file" )
875+ check ("file/" , True , "/file" )
875876 check ("file/file2" , False , "/file/file2" )
876- # check("file/file2", ALL_BUT_LAST, NotADirectoryError )
877- # check("file/file2", True, NotADirectoryError )
877+ check ("file/file2" , ALL_BUT_LAST , FileNotFoundError )
878+ check ("file/file2" , True , FileNotFoundError )
878879 check ("file/." , False , "/file" )
879- # check("file/.", ALL_BUT_LAST, NotADirectoryError )
880- # check("file/.", True, NotADirectoryError )
880+ check ("file/." , ALL_BUT_LAST , "/file" )
881+ check ("file/." , True , "/file" )
881882 check ("file/../link2" , False , "/dir" )
882883 check ("file/../link2" , ALL_BUT_LAST , "/dir" )
883884 check ("file/../link2" , True , "/dir" )
@@ -896,14 +897,14 @@ def check(path, mode, expected, errno=None):
896897 check ("link" , ALL_BUT_LAST , "/file" )
897898 check ("link" , True , "/file" )
898899 check ("link/" , False , "/file" )
899- # check("link/", ALL_BUT_LAST, NotADirectoryError )
900- # check("link/", True, NotADirectoryError )
900+ check ("link/" , ALL_BUT_LAST , "/file" )
901+ check ("link/" , True , "/file" )
901902 check ("link/file2" , False , "/file/file2" )
902- # check("link/file2", ALL_BUT_LAST, NotADirectoryError )
903- # check("link/file2", True, NotADirectoryError )
903+ check ("link/file2" , ALL_BUT_LAST , FileNotFoundError )
904+ check ("link/file2" , True , FileNotFoundError )
904905 check ("link/." , False , "/file" )
905- # check("link/.", ALL_BUT_LAST, NotADirectoryError )
906- # check("link/.", True, NotADirectoryError )
906+ check ("link/." , ALL_BUT_LAST , "/file" )
907+ check ("link/." , True , "/file" )
907908 check ("link/../link" , False , "/file" )
908909 check ("link/../link" , ALL_BUT_LAST , "/file" )
909910 check ("link/../link" , True , "/file" )
0 commit comments