Skip to content

Commit a55b72d

Browse files
committed
Skip test on Window
Signed-off-by: Uilian Ries <uilianr@jfrog.com>
1 parent f39514e commit a55b72d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/run_tests.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import shutil
3838
import unittest
3939
import stat
40+
import platform
4041
from os import listdir, chmod
4142
from os.path import abspath, dirname, exists, join, isdir, isfile
4243
from 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

Comments
 (0)