MCPcopy Index your code
hub / github.com/python/cpython / test_copy2_xattr

Method test_copy2_xattr

Lib/test/test_shutil.py:1440–1450  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1438
1439 @os_helper.skip_unless_xattr
1440 def test_copy2_xattr(self):
1441 tmp_dir = self.mkdtemp()
1442 src = os.path.join(tmp_dir, 'foo')
1443 dst = os.path.join(tmp_dir, 'bar')
1444 create_file(src, 'foo')
1445 os.setxattr(src, 'user.foo', b'42')
1446 shutil.copy2(src, dst)
1447 self.assertEqual(
1448 os.getxattr(src, 'user.foo'),
1449 os.getxattr(dst, 'user.foo'))
1450 os.remove(dst)
1451
1452 def test_copy_return_value(self):
1453 # copy and copy2 both return their destination path.

Callers

nothing calls this directly

Calls 7

mkdtempMethod · 0.80
setxattrMethod · 0.80
getxattrMethod · 0.80
create_fileFunction · 0.70
joinMethod · 0.45
assertEqualMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected