@@ -1746,21 +1746,14 @@ def test_exist_ok_existing_regular_file(self):
1746
1746
@unittest .skipUnless (os .name == 'nt' , "requires Windows" )
1747
1747
def test_win32_mkdir_700 (self ):
1748
1748
base = os_helper .TESTFN
1749
- path1 = os .path .join (os_helper .TESTFN , 'dir1' )
1750
- path2 = os .path .join (os_helper .TESTFN , 'dir2' )
1751
- # mode=0o700 is special-cased to override ACLs on Windows
1752
- # There's no way to know exactly how the ACLs will look, so we'll
1753
- # check that they are different from a regularly created directory.
1754
- os .mkdir (path1 , mode = 0o700 )
1755
- os .mkdir (path2 , mode = 0o777 )
1756
-
1757
- out1 = subprocess .check_output (["icacls.exe" , path1 ], encoding = "oem" )
1758
- out2 = subprocess .check_output (["icacls.exe" , path2 ], encoding = "oem" )
1759
- os .rmdir (path1 )
1760
- os .rmdir (path2 )
1761
- out1 = out1 .replace (path1 , "<PATH>" )
1762
- out2 = out2 .replace (path2 , "<PATH>" )
1763
- self .assertNotEqual (out1 , out2 )
1749
+ path = os .path .abspath (os .path .join (os_helper .TESTFN , 'dir' ))
1750
+ os .mkdir (path , mode = 0o700 )
1751
+ out = subprocess .check_output (["cacls.exe" , path , "/s" ], encoding = "oem" )
1752
+ os .rmdir (path )
1753
+ self .assertEqual (
1754
+ out .strip (),
1755
+ f'{ path } "D:P(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;FA;;;OW)"' ,
1756
+ )
1764
1757
1765
1758
def tearDown (self ):
1766
1759
path = os .path .join (os_helper .TESTFN , 'dir1' , 'dir2' , 'dir3' ,
0 commit comments