Skip to content

Commit 6023ccd

Browse files
committed
Improve error message when safe_copy permissions tests fail.
1 parent 96d62b0 commit 6023ccd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

CIME/tests/test_unit_safe_copy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def test_safe_copy_preserve_meta_true(self):
121121

122122
tgt_stat = os.stat(tgt_file)
123123
# Check that permissions are preserved (masking out file type bits)
124-
self.assertEqual(stat.S_IMODE(src_stat.st_mode), stat.S_IMODE(tgt_stat.st_mode))
124+
self.assertEqual(oct(stat.S_IMODE(src_stat.st_mode)), oct(stat.S_IMODE(tgt_stat.st_mode)))
125125

126126
def test_safe_copy_preserve_meta_false(self):
127127
"""
@@ -151,7 +151,7 @@ def test_safe_copy_preserve_meta_false(self):
151151
# intended behavior with preserve_meta=False according to the safe_copy docstring.
152152
tgt_stat = os.stat(tgt_file)
153153
self.assertNotEqual(
154-
stat.S_IMODE(src_stat.st_mode), stat.S_IMODE(tgt_stat.st_mode)
154+
oct(stat.S_IMODE(src_stat.st_mode)), oct(stat.S_IMODE(tgt_stat.st_mode))
155155
)
156156

157157
def test_safe_copy_executable_file(self):
@@ -222,7 +222,7 @@ def test_safe_copy_directory_preserve_meta_false(self):
222222
# Verify that permissions are NOT preserved (should be different from source)
223223
tgt_stat = os.stat(tgt_file)
224224
self.assertNotEqual(
225-
stat.S_IMODE(src_stat.st_mode), stat.S_IMODE(tgt_stat.st_mode)
225+
oct(stat.S_IMODE(src_stat.st_mode)), oct(stat.S_IMODE(tgt_stat.st_mode))
226226
)
227227

228228
def test_safe_copy_nested_directory(self):
@@ -312,7 +312,7 @@ def test_safe_copy_with_shared_area_preserve_meta_true(self):
312312

313313
# Target should have same permissions as source (ignoring SharedArea umask)
314314
tgt_stat = os.stat(tgt_file)
315-
self.assertEqual(stat.S_IMODE(src_stat.st_mode), stat.S_IMODE(tgt_stat.st_mode))
315+
self.assertEqual(oct(stat.S_IMODE(src_stat.st_mode)), oct(stat.S_IMODE(tgt_stat.st_mode)))
316316

317317
def test_safe_copy_directory_with_shared_area_preserve_meta_false(self):
318318
"""

0 commit comments

Comments
 (0)