summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_shutil.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r--Lib/test/test_shutil.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index a2b6e88..cbbc36f 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -410,6 +410,16 @@ class TestShutil(unittest.TestCase):
finally:
os.setxattr = orig_setxattr
+ # test that shutil.copystat copies xattrs
+ src = os.path.join(tmp_dir, 'the_original')
+ write_file(src, src)
+ os.setxattr(src, 'user.the_value', b'fiddly')
+ dst = os.path.join(tmp_dir, 'the_copy')
+ write_file(dst, dst)
+ shutil.copystat(src, dst)
+ self.assertEqual(os.listxattr(src), ['user.the_value'])
+ self.assertEqual(os.getxattr(src, 'user.the_value'), b'fiddly')
+
@support.skip_unless_symlink
@support.skip_unless_xattr
@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0,