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

Method test_copy_dir

Lib/test/test_pathlib/test_copy.py:67–77  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

65 self.assertRaises(OSError, source.copy, source, follow_symlinks=False)
66
67 def test_copy_dir(self):
68 source = self.source_root / 'dirC'
69 target = self.target_root / 'copyC'
70 result = source.copy(target)
71 self.assertEqual(result, target)
72 self.assertTrue(self.target_ground.isdir(target))
73 self.assertTrue(self.target_ground.isfile(target / 'fileC'))
74 self.assertEqual(self.target_ground.readtext(target / 'fileC'), 'this is file C\n')
75 self.assertTrue(self.target_ground.isdir(target / 'dirD'))
76 self.assertTrue(self.target_ground.isfile(target / 'dirD' / 'fileD'))
77 self.assertEqual(self.target_ground.readtext(target / 'dirD' / 'fileD'), 'this is file D\n')
78
79 def test_copy_dir_follow_symlinks_true(self):
80 if not self.source_ground.can_symlink:

Callers

nothing calls this directly

Calls 6

assertTrueMethod · 0.80
copyMethod · 0.45
assertEqualMethod · 0.45
isdirMethod · 0.45
isfileMethod · 0.45
readtextMethod · 0.45

Tested by

no test coverage detected