@@ -1814,21 +1814,14 @@ def test_exist_ok_existing_regular_file(self):
1814
1814
@unittest .skipUnless (os .name == 'nt' , "requires Windows" )
1815
1815
def test_win32_mkdir_700 (self ):
1816
1816
base = os_helper .TESTFN
1817
- path1 = os .path .join (os_helper .TESTFN , 'dir1' )
1818
- path2 = os .path .join (os_helper .TESTFN , 'dir2' )
1819
- # mode=0o700 is special-cased to override ACLs on Windows
1820
- # There's no way to know exactly how the ACLs will look, so we'll
1821
- # check that they are different from a regularly created directory.
1822
- os .mkdir (path1 , mode = 0o700 )
1823
- os .mkdir (path2 , mode = 0o777 )
1824
-
1825
- out1 = subprocess .check_output (["icacls.exe" , path1 ], encoding = "oem" )
1826
- out2 = subprocess .check_output (["icacls.exe" , path2 ], encoding = "oem" )
1827
- os .rmdir (path1 )
1828
- os .rmdir (path2 )
1829
- out1 = out1 .replace (path1 , "<PATH>" )
1830
- out2 = out2 .replace (path2 , "<PATH>" )
1831
- self .assertNotEqual (out1 , out2 )
1817
+ path = os .path .abspath (os .path .join (os_helper .TESTFN , 'dir' ))
1818
+ os .mkdir (path , mode = 0o700 )
1819
+ out = subprocess .check_output (["cacls.exe" , path , "/s" ], encoding = "oem" )
1820
+ os .rmdir (path )
1821
+ self .assertEqual (
1822
+ out .strip (),
1823
+ f'{ path } "D:P(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;FA;;;OW)"' ,
1824
+ )
1832
1825
1833
1826
def tearDown (self ):
1834
1827
path = os .path .join (os_helper .TESTFN , 'dir1' , 'dir2' , 'dir3' ,
0 commit comments