(self)
| 974 | shutil.copytree(src_dir, dst_dir) |
| 975 | |
| 976 | def test_copytree_custom_copy_function(self): |
| 977 | # See: https://bugs.python.org/issue35648 |
| 978 | def custom_cpfun(a, b): |
| 979 | flag.append(None) |
| 980 | self.assertIsInstance(a, str) |
| 981 | self.assertIsInstance(b, str) |
| 982 | self.assertEqual(a, os.path.join(src, 'foo')) |
| 983 | self.assertEqual(b, os.path.join(dst, 'foo')) |
| 984 | |
| 985 | flag = [] |
| 986 | src = self.mkdtemp() |
| 987 | dst = tempfile.mktemp(dir=self.mkdtemp()) |
| 988 | create_file(os.path.join(src, 'foo')) |
| 989 | shutil.copytree(src, dst, copy_function=custom_cpfun) |
| 990 | self.assertEqual(len(flag), 1) |
| 991 | |
| 992 | # Issue #3002: copyfile and copytree block indefinitely on named pipes |
| 993 | @unittest.skipUnless(hasattr(os, "mkfifo"), 'requires os.mkfifo()') |
nothing calls this directly
no test coverage detected