3737import shutil
3838import unittest
3939import stat
40+ import platform
4041from os import listdir , chmod
4142from os .path import abspath , dirname , exists , join , isdir , isfile
4243from tempfile import mkdtemp
@@ -498,6 +499,7 @@ def tearDown(self):
498499 os .chdir (self .save_cwd )
499500 remove_tree_force (self .tmpdir )
500501
502+ @unittest .skipIf (platform .system () == "Windows" , "File permission modes are not supported on Windows" )
501503 def test_handle_full_index_patch_format (self ):
502504 """Test that when file permission mode is listed in the patch,
503505 the same should be applied to the target file after patching.
@@ -510,8 +512,7 @@ def test_handle_full_index_patch_format(self):
510512 self .assertEqual (pto .items [0 ].filemode , 0o100755 )
511513 self .assertTrue (pto .apply ())
512514 self .assertTrue (os .path .exists (join (self .tmpdir , 'quote.txt' )))
513- expected_mode = 0o666 if os .name == 'nt' else 0o755
514- self .assertEqual (os .stat (join (self .tmpdir , 'quote.txt' )).st_mode , expected_mode | stat .S_IFREG )
515+ self .assertEqual (os .stat (join (self .tmpdir , 'quote.txt' )).st_mode , 0o755 | stat .S_IFREG )
515516
516517 pto = patch_ng .fromfile (join (self .tmpdir , 'filepermission' , 'update644.patch' ))
517518 self .assertEqual (len (pto ), 1 )
0 commit comments