• Home
  • Raw
  • Download

Lines Matching refs:os

9 import os
10 import os.path
44 builtin_rename = os.rename
45 os.rename = _fake_rename
48 os.rename = builtin_rename
59 path = os.path.join(*path)
71 path = os.path.join(*path)
77 for name in sorted(os.listdir(path)):
78 p = os.path.join(path, name)
79 if os.path.isdir(p) and not os.path.islink(p):
98 shutil.rmtree(d, os.name in ('nt', 'cygwin'))
112 victim = os.path.join(tmp, 'killme')
113 os.mkdir(victim)
114 write_file(os.path.join(victim, 'somefile'), 'foo')
115 victim = os.fsencode(victim)
122 dir_ = os.path.join(tmp, 'dir')
123 os.mkdir(dir_)
124 link = os.path.join(tmp, 'link')
125 os.symlink(dir_, link)
127 self.assertTrue(os.path.exists(dir_))
128 self.assertTrue(os.path.lexists(link))
134 self.assertIs(errors[0][0], os.path.islink)
141 dir1 = os.path.join(tmp, 'dir1')
142 dir2 = os.path.join(dir1, 'dir2')
143 dir3 = os.path.join(tmp, 'dir3')
145 os.mkdir(d)
146 file1 = os.path.join(tmp, 'file1')
148 link1 = os.path.join(dir1, 'link1')
149 os.symlink(dir2, link1)
150 link2 = os.path.join(dir1, 'link2')
151 os.symlink(dir3, link2)
152 link3 = os.path.join(dir1, 'link3')
153 os.symlink(file1, link3)
156 self.assertFalse(os.path.exists(dir1))
157 self.assertTrue(os.path.exists(dir3))
158 self.assertTrue(os.path.exists(file1))
170 filename = os.path.join(tmpdir, "tstfile")
175 possible_args = [filename, os.path.join(filename, '*.*')]
177 self.assertTrue(os.path.exists(filename))
180 self.assertTrue(os.path.exists(filename))
186 self.assertIs(errors[0][0], os.scandir)
190 self.assertIs(errors[1][0], os.rmdir)
196 @unittest.skipUnless(hasattr(os, 'chmod'), 'requires os.chmod()')
199 @unittest.skipIf(hasattr(os, 'geteuid') and os.geteuid() == 0,
203 os.mkdir(TESTFN)
206 self.child_file_path = os.path.join(TESTFN, 'a')
207 self.child_dir_path = os.path.join(TESTFN, 'b')
209 os.mkdir(self.child_dir_path)
210 old_dir_mode = os.stat(TESTFN).st_mode
211 old_child_file_mode = os.stat(self.child_file_path).st_mode
212 old_child_dir_mode = os.stat(self.child_dir_path).st_mode
215 os.chmod(self.child_file_path, new_mode)
216 os.chmod(self.child_dir_path, new_mode)
217 os.chmod(TESTFN, new_mode)
219 self.addCleanup(os.chmod, TESTFN, old_dir_mode)
220 self.addCleanup(os.chmod, self.child_file_path, old_child_file_mode)
221 self.addCleanup(os.chmod, self.child_dir_path, old_child_dir_mode)
240 if func is os.unlink:
242 elif func is os.rmdir:
245 self.assertIs(func, os.listdir)
250 self.assertEqual(func, os.rmdir)
257 orig_lstat = os.lstat
263 os.lstat = raiser
265 os.mkdir(TESTFN)
269 os.lstat = orig_lstat
271 @unittest.skipUnless(hasattr(os, 'chmod'), 'requires os.chmod')
275 src = os.path.join(tmp_dir, 'foo')
276 dst = os.path.join(tmp_dir, 'bar')
277 src_link = os.path.join(tmp_dir, 'baz')
278 dst_link = os.path.join(tmp_dir, 'quux')
281 os.symlink(src, src_link)
282 os.symlink(dst, dst_link)
283 os.chmod(src, stat.S_IRWXU|stat.S_IRWXG)
285 os.chmod(dst, stat.S_IRWXO)
286 self.assertNotEqual(os.stat(src).st_mode, os.stat(dst).st_mode)
288 self.assertEqual(os.stat(src).st_mode, os.stat(dst).st_mode)
290 if os.name != 'nt':
292 os.chmod(dst, stat.S_IRWXO)
294 self.assertEqual(os.stat(src).st_mode, os.stat(dst).st_mode)
296 os.chmod(dst, stat.S_IRWXO)
298 self.assertEqual(os.stat(src).st_mode, os.stat(dst).st_mode)
300 os.chmod(dst, stat.S_IRWXO)
302 self.assertEqual(os.stat(src).st_mode, os.stat(dst).st_mode)
304 @unittest.skipUnless(hasattr(os, 'lchmod'), 'requires os.lchmod')
308 src = os.path.join(tmp_dir, 'foo')
309 dst = os.path.join(tmp_dir, 'bar')
310 src_link = os.path.join(tmp_dir, 'baz')
311 dst_link = os.path.join(tmp_dir, 'quux')
314 os.symlink(src, src_link)
315 os.symlink(dst, dst_link)
316 os.chmod(src, stat.S_IRWXU|stat.S_IRWXG)
317 os.chmod(dst, stat.S_IRWXU)
318 os.lchmod(src_link, stat.S_IRWXO|stat.S_IRWXG)
320 os.lchmod(dst_link, stat.S_IRWXO)
322 self.assertEqual(os.lstat(src_link).st_mode,
323 os.lstat(dst_link).st_mode)
324 self.assertNotEqual(os.stat(src).st_mode, os.stat(dst).st_mode)
326 os.lchmod(dst_link, stat.S_IRWXO)
328 self.assertEqual(os.stat(src).st_mode, os.stat(dst).st_mode)
330 os.lchmod(dst_link, stat.S_IRWXO)
332 self.assertEqual(os.stat(src).st_mode, os.stat(dst).st_mode)
334 @unittest.skipIf(hasattr(os, 'lchmod'), 'requires os.lchmod to be missing')
338 src = os.path.join(tmp_dir, 'foo')
339 dst = os.path.join(tmp_dir, 'bar')
340 src_link = os.path.join(tmp_dir, 'baz')
341 dst_link = os.path.join(tmp_dir, 'quux')
344 os.symlink(src, src_link)
345 os.symlink(dst, dst_link)
351 src = os.path.join(tmp_dir, 'foo')
352 dst = os.path.join(tmp_dir, 'bar')
353 src_link = os.path.join(tmp_dir, 'baz')
354 dst_link = os.path.join(tmp_dir, 'qux')
356 src_stat = os.stat(src)
357 os.utime(src, (src_stat.st_atime,
360 self.assertNotEqual(os.stat(src).st_mtime, os.stat(dst).st_mtime)
361 os.symlink(src, src_link)
362 os.symlink(dst, dst_link)
363 if hasattr(os, 'lchmod'):
364 os.lchmod(src_link, stat.S_IRWXO)
365 if hasattr(os, 'lchflags') and hasattr(stat, 'UF_NODUMP'):
366 os.lchflags(src_link, stat.UF_NODUMP)
367 src_link_stat = os.lstat(src_link)
369 if hasattr(os, 'lchmod'):
371 self.assertNotEqual(src_link_stat.st_mode, os.stat(dst).st_mode)
374 dst_link_stat = os.lstat(dst_link)
375 if os.utime in os.supports_follow_symlinks:
380 if hasattr(os, 'lchmod'):
382 if hasattr(os, 'lchflags') and hasattr(src_link_stat, 'st_flags'):
386 self.assertTrue(abs(os.stat(src).st_mtime - os.stat(dst).st_mtime) <
389 @unittest.skipUnless(hasattr(os, 'chflags') and
395 file1 = os.path.join(tmpdir, 'file1')
396 file2 = os.path.join(tmpdir, 'file2')
407 old_chflags = os.chflags
410 os.chflags = make_chflags_raiser(err)
413 os.chflags = make_chflags_raiser(errno.EOPNOTSUPP + errno.ENOTSUP)
416 os.chflags = old_chflags
421 src = os.path.join(tmp_dir, 'foo')
423 dst = os.path.join(tmp_dir, 'bar')
429 os.setxattr(src, 'user.foo', b'42')
430 os.setxattr(src, 'user.bar', b'43')
432 self.assertEqual(sorted(os.listxattr(src)), sorted(os.listxattr(dst)))
434 os.getxattr(src, 'user.foo'),
435 os.getxattr(dst, 'user.foo'))
437 os.remove(dst)
447 orig_setxattr = os.setxattr
448 os.setxattr = _raise_on_user_foo
450 self.assertIn('user.bar', os.listxattr(dst))
452 os.setxattr = orig_setxattr
459 orig_listxattr = os.listxattr
460 os.listxattr = _raise_on_src
463 os.listxattr = orig_listxattr
466 src = os.path.join(tmp_dir, 'the_original')
468 os.setxattr(src, 'user.the_value', b'fiddly')
469 dst = os.path.join(tmp_dir, 'the_copy')
472 self.assertEqual(os.getxattr(dst, 'user.the_value'), b'fiddly')
476 @unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0,
483 src = os.path.join(tmp_dir, 'foo')
484 src_link = os.path.join(tmp_dir, 'baz')
486 os.symlink(src, src_link)
487 os.setxattr(src, 'trusted.foo', b'42')
488 os.setxattr(src_link, 'trusted.foo', b'43', follow_symlinks=False)
489 dst = os.path.join(tmp_dir, 'bar')
490 dst_link = os.path.join(tmp_dir, 'qux')
492 os.symlink(dst, dst_link)
494 self.assertEqual(os.getxattr(dst_link, 'trusted.foo', follow_symlinks=False), b'43')
495 self.assertRaises(OSError, os.getxattr, dst, 'trusted.foo')
497 self.assertEqual(os.getxattr(dst, 'trusted.foo'), b'43')
502 src = os.path.join(tmp_dir, 'foo')
503 dst = os.path.join(tmp_dir, 'bar')
504 src_link = os.path.join(tmp_dir, 'baz')
506 os.symlink(src, src_link)
507 if hasattr(os, 'lchmod'):
508 os.lchmod(src_link, stat.S_IRWXU | stat.S_IRWXO)
511 self.assertFalse(os.path.islink(dst))
513 os.remove(dst)
516 self.assertTrue(os.path.islink(dst))
517 self.assertEqual(os.readlink(dst), os.readlink(src_link))
518 if hasattr(os, 'lchmod'):
519 self.assertEqual(os.lstat(src_link).st_mode,
520 os.lstat(dst).st_mode)
525 src = os.path.join(tmp_dir, 'foo')
526 dst = os.path.join(tmp_dir, 'bar')
527 src_link = os.path.join(tmp_dir, 'baz')
529 os.symlink(src, src_link)
530 if hasattr(os, 'lchmod'):
531 os.lchmod(src_link, stat.S_IRWXU | stat.S_IRWXO)
532 if hasattr(os, 'lchflags') and hasattr(stat, 'UF_NODUMP'):
533 os.lchflags(src_link, stat.UF_NODUMP)
534 src_stat = os.stat(src)
535 src_link_stat = os.lstat(src_link)
538 self.assertFalse(os.path.islink(dst))
540 os.remove(dst)
543 self.assertTrue(os.path.islink(dst))
544 self.assertEqual(os.readlink(dst), os.readlink(src_link))
545 dst_stat = os.lstat(dst)
546 if os.utime in os.supports_follow_symlinks:
551 if hasattr(os, 'lchmod'):
554 if hasattr(os, 'lchflags') and hasattr(src_link_stat, 'st_flags'):
560 src = os.path.join(tmp_dir, 'foo')
561 dst = os.path.join(tmp_dir, 'bar')
563 os.setxattr(src, 'user.foo', b'42')
566 os.getxattr(src, 'user.foo'),
567 os.getxattr(dst, 'user.foo'))
568 os.remove(dst)
573 src = os.path.join(tmp_dir, 'src')
574 dst = os.path.join(tmp_dir, 'dst')
575 dst_link = os.path.join(tmp_dir, 'dst_link')
576 link = os.path.join(tmp_dir, 'link')
578 os.symlink(src, link)
581 self.assertTrue(os.path.islink(dst_link))
582 self.assertEqual(os.readlink(link), os.readlink(dst_link))
585 self.assertFalse(os.path.islink(dst))
588 _use_fd_functions = ({os.open, os.stat, os.unlink, os.rmdir} <=
589 os.supports_dir_fd and
590 os.listdir in os.supports_fd and
591 os.stat in os.supports_follow_symlinks)
596 d = os.path.join(tmp_dir, 'a')
597 os.mkdir(d)
614 os.close(handle)
616 os.remove(path)
620 dst_dir = os.path.join(tempfile.mkdtemp(), 'destination')
622 self.addCleanup(shutil.rmtree, os.path.dirname(dst_dir))
624 os.mkdir(os.path.join(src_dir, 'test_dir'))
628 self.assertTrue(os.path.isfile(os.path.join(dst_dir, 'test.txt')))
629 self.assertTrue(os.path.isdir(os.path.join(dst_dir, 'test_dir')))
630 self.assertTrue(os.path.isfile(os.path.join(dst_dir, 'test_dir',
640 src_dir = os.path.join(tmp_dir, 'src')
641 dst_dir = os.path.join(tmp_dir, 'dst')
642 sub_dir = os.path.join(src_dir, 'sub')
643 os.mkdir(src_dir)
644 os.mkdir(sub_dir)
646 src_link = os.path.join(sub_dir, 'link')
647 dst_link = os.path.join(dst_dir, 'sub/link')
648 os.symlink(os.path.join(src_dir, 'file.txt'),
650 if hasattr(os, 'lchmod'):
651 os.lchmod(src_link, stat.S_IRWXU | stat.S_IRWXO)
652 if hasattr(os, 'lchflags') and hasattr(stat, 'UF_NODUMP'):
653 os.lchflags(src_link, stat.UF_NODUMP)
654 src_stat = os.lstat(src_link)
656 self.assertTrue(os.path.islink(os.path.join(dst_dir, 'sub', 'link')))
657 self.assertEqual(os.readlink(os.path.join(dst_dir, 'sub', 'link')),
658 os.path.join(src_dir, 'file.txt'))
659 dst_stat = os.lstat(dst_link)
660 if hasattr(os, 'lchmod'):
662 if hasattr(os, 'lchflags'):
667 join = os.path.join
668 exists = os.path.exists
674 os.mkdir(join(src_dir, 'test_dir'))
676 os.mkdir(join(src_dir, 'test_dir2'))
678 os.mkdir(join(src_dir, 'test_dir2', 'subdir'))
679 os.mkdir(join(src_dir, 'test_dir2', 'subdir2'))
708 path = os.path.join(src, name)
710 if (os.path.isdir(path) and
713 elif os.path.splitext(path)[-1] in ('.py'):
728 shutil.rmtree(os.path.dirname(dst_dir))
732 src_dir = os.path.join(tmp_dir, 'source')
733 os.mkdir(src_dir)
734 dst_dir = os.path.join(tmp_dir, 'destination')
737 os.chmod(src_dir, 0o777)
739 os.chmod(os.path.join(src_dir, 'permissive.txt'), 0o777)
741 os.chmod(os.path.join(src_dir, 'restrictive.txt'), 0o600)
743 os.chmod(restrictive_subdir, 0o600)
746 self.assertEqual(os.stat(src_dir).st_mode, os.stat(dst_dir).st_mode)
747 self.assertEqual(os.stat(os.path.join(src_dir, 'permissive.txt')).st_mode,
748 os.stat(os.path.join(dst_dir, 'permissive.txt')).st_mode)
749 self.assertEqual(os.stat(os.path.join(src_dir, 'restrictive.txt')).st_mode,
750 os.stat(os.path.join(dst_dir, 'restrictive.txt')).st_mode)
751 restrictive_subdir_dst = os.path.join(dst_dir,
752 os.path.split(restrictive_subdir)[1])
753 self.assertEqual(os.stat(restrictive_subdir).st_mode,
754 os.stat(restrictive_subdir_dst).st_mode)
762 dst_dir = os.path.join(tempfile.mkdtemp(), 'destination')
764 self.addCleanup(shutil.rmtree, os.path.dirname(dst_dir))
770 @unittest.skipIf(os.name == 'nt', 'temporarily disabled on Windows')
771 @unittest.skipUnless(hasattr(os, 'link'), 'requires os.link')
774 os.mkdir(TESTFN)
775 src = os.path.join(TESTFN, 'cheese')
776 dst = os.path.join(TESTFN, 'shop')
781 os.link(src, dst)
787 os.remove(dst)
794 os.mkdir(TESTFN)
795 src = os.path.join(TESTFN, 'cheese')
796 dst = os.path.join(TESTFN, 'shop')
803 os.symlink('cheese', dst)
807 os.remove(dst)
814 os.mkdir(TESTFN)
816 src = os.path.join(TESTFN, 'cheese')
817 dst = os.path.join(TESTFN, 'shop')
818 os.mkdir(src)
819 os.symlink(src, dst)
826 @unittest.skipUnless(hasattr(os, "mkfifo"), 'requires os.mkfifo()')
829 os.mkfifo(TESTFN)
838 os.remove(TESTFN)
840 @unittest.skipUnless(hasattr(os, "mkfifo"), 'requires os.mkfifo()')
843 os.mkdir(TESTFN)
845 subdir = os.path.join(TESTFN, "subdir")
846 os.mkdir(subdir)
847 pipe = os.path.join(subdir, "mypipe")
849 os.mkfifo(pipe)
868 dst_dir = os.path.join(self.mkdtemp(), 'destination')
870 os.mkdir(os.path.join(src_dir, 'test_dir'))
885 dst_dir = os.path.join(self.mkdtemp(), 'destination')
886 os.symlink('IDONTEXIST', os.path.join(src_dir, 'test.txt'))
887 os.mkdir(os.path.join(src_dir, 'test_dir'))
892 dst_dir = os.path.join(self.mkdtemp(), 'destination2')
894 self.assertNotIn('test.txt', os.listdir(dst_dir))
897 dst_dir = os.path.join(self.mkdtemp(), 'destination3')
899 self.assertIn('test.txt', os.listdir(dst_dir))
904 dst_dir = os.path.join(self.mkdtemp(), 'destination')
905 os.mkdir(os.path.join(src_dir, 'real_dir'))
906 with open(os.path.join(src_dir, 'real_dir', 'test.txt'), 'w'):
908 os.symlink(os.path.join(src_dir, 'real_dir'),
909 os.path.join(src_dir, 'link_to_dir'),
913 self.assertFalse(os.path.islink(os.path.join(dst_dir, 'link_to_dir')))
914 self.assertIn('test.txt', os.listdir(os.path.join(dst_dir, 'link_to_dir')))
916 dst_dir = os.path.join(self.mkdtemp(), 'destination2')
918 self.assertTrue(os.path.islink(os.path.join(dst_dir, 'link_to_dir')))
919 self.assertIn('test.txt', os.listdir(os.path.join(dst_dir, 'link_to_dir')))
925 file1 = os.path.join(tmpdir, fname)
928 file2 = os.path.join(tmpdir2, fname)
931 @unittest.skipUnless(hasattr(os, 'chmod'), 'requires os.chmod')
935 self.assertTrue(os.path.exists(file2))
936 self.assertEqual(os.stat(file1).st_mode, os.stat(file2).st_mode)
938 @unittest.skipUnless(hasattr(os, 'chmod'), 'requires os.chmod')
939 @unittest.skipUnless(hasattr(os, 'utime'), 'requires os.utime')
944 self.assertTrue(os.path.exists(file2))
945 file1_stat = os.stat(file1)
946 file2_stat = os.stat(file2)
952 if hasattr(os, 'chflags') and hasattr(file1_stat, 'st_flags'):
963 os.rmdir(tmpdir2)
965 work_dir = os.path.dirname(tmpdir2)
966 rel_base_name = os.path.join(os.path.basename(tmpdir2), 'archive')
969 base_name = os.path.abspath(rel_base_name)
974 self.assertTrue(os.path.isfile(tarball))
985 self.assertTrue(os.path.isfile(tarball))
1001 dist = os.path.join(root_dir, base_dir)
1002 os.makedirs(dist, exist_ok=True)
1005 os.mkdir(os.path.join(dist, 'sub'))
1007 os.mkdir(os.path.join(dist, 'sub2'))
1017 base_name = os.path.join(self.mkdtemp(), 'archive')
1022 self.assertTrue(os.path.isfile(tarball))
1025 tarball2 = os.path.join(root_dir, 'archive2.tar')
1030 self.assertTrue(os.path.isfile(tarball2))
1037 self.assertTrue(os.path.isfile(tarball))
1043 self.assertTrue(os.path.isfile(tarball))
1052 os.rmdir(tmpdir2)
1054 work_dir = os.path.dirname(tmpdir2)
1055 rel_base_name = os.path.join(os.path.basename(tmpdir2), 'archive')
1058 base_name = os.path.abspath(rel_base_name)
1062 self.assertTrue(os.path.isfile(res))
1071 base_name = os.path.abspath(rel_base_name)
1075 self.assertTrue(os.path.isfile(res))
1087 base_name = os.path.join(self.mkdtemp(), 'archive')
1092 self.assertTrue(os.path.isfile(archive))
1095 archive2 = os.path.join(root_dir, 'archive2.zip')
1100 self.assertTrue(os.path.isfile(archive2))
1113 base_name = os.path.join(self.mkdtemp(), 'archive')
1118 self.assertTrue(os.path.isfile(archive))
1134 base_name = os.path.join(tmpdir, 'archive')
1148 base_name = os.path.join(self.mkdtemp(), 'archive')
1151 self.assertTrue(os.path.isfile(res))
1154 self.assertTrue(os.path.isfile(res))
1158 self.assertTrue(os.path.isfile(res))
1162 self.assertTrue(os.path.isfile(res))
1169 base_name = os.path.join(self.mkdtemp(), 'archive')
1177 self.assertTrue(os.path.isfile(archive_name))
1189 current_dir = os.getcwd()
1199 self.assertEqual(os.getcwd(), current_dir)
1208 self.assertTrue(os.path.isfile('test.tar'))
1216 self.assertTrue(os.path.isfile('test.zip'))
1244 base_name = os.path.join(self.mkdtemp(), 'archive')
1308 usage = shutil.disk_usage(os.path.dirname(__file__))
1316 @unittest.skipUnless(hasattr(os, 'chown'), 'requires os.chown')
1339 uid = os.getuid()
1340 gid = os.getgid()
1343 s = os.stat(filename)
1379 src = os.path.join(src_dir, 'foo')
1382 self.assertEqual(rv, os.path.join(dst_dir, 'foo'))
1383 rv = fn(src, os.path.join(dst_dir, 'bar'))
1384 self.assertEqual(rv, os.path.join(dst_dir, 'bar'))
1390 dst_file = os.path.join(dst_dir, 'bar')
1391 src_file = os.path.join(src_dir, 'foo')
1394 self.assertTrue(os.path.exists(rv))
1401 src_file = os.path.join(src_dir, 'foo')
1412 src = os.path.join(src_dir, 'foo')
1415 self.assertEqual(['foo'], os.listdir(rv))
1428 os.chmod(self.temp_file.name, stat.S_IXUSR)
1430 self.dir, self.file = os.path.split(self.temp_file.name)
1446 base_dir, tail_dir = os.path.split(self.dir)
1447 relpath = os.path.join(tail_dir, self.file)
1458 base_dir = os.path.dirname(self.dir)
1463 self.assertEqual(rv, os.path.join(os.curdir, self.file))
1468 @unittest.skipIf(hasattr(os, 'geteuid') and os.geteuid() == 0,
1472 os.chmod(self.temp_file.name, stat.S_IREAD)
1473 if os.access(self.temp_file.name, os.W_OK):
1475 rv = shutil.which(self.file, path=self.dir, mode=os.W_OK)
1479 base_dir, tail_dir = os.path.split(self.dir)
1482 self.assertEqual(rv, os.path.join(tail_dir, self.file))
1504 base_dir = os.path.dirname(self.dir)
1524 self.src_file = os.path.join(self.src_dir, filename)
1525 self.dst_file = os.path.join(self.dst_dir, filename)
1543 self.assertFalse(os.path.exists(src))
1546 contents = sorted(os.listdir(src))
1548 self.assertEqual(contents, sorted(os.listdir(real_dst)))
1549 self.assertFalse(os.path.exists(src))
1588 os.path.join(self.dst_dir, os.path.basename(self.src_dir)))
1596 self._check_move_dir(self.src_dir + os.path.sep, self.dst_dir,
1597 os.path.join(self.dst_dir, os.path.basename(self.src_dir)))
1599 @unittest.skipUnless(os.path.altsep, 'requires os.path.altsep')
1601 self._check_move_dir(self.src_dir + os.path.altsep, self.dst_dir,
1602 os.path.join(self.dst_dir, os.path.basename(self.src_dir)))
1612 dst = os.path.join(self.src_dir, "bar")
1616 os.mkdir(TESTFN)
1619 src = os.path.join(TESTFN, src)
1620 dst = os.path.join(TESTFN, dst)
1628 os.mkdir(TESTFN)
1631 src = os.path.join(TESTFN, src)
1632 dst = os.path.join(TESTFN, dst)
1642 dst = os.path.join(self.src_dir, 'bar')
1643 os.symlink(self.src_file, dst)
1645 self.assertTrue(os.path.islink(self.dst_file))
1646 self.assertTrue(os.path.samefile(self.src_file, self.dst_file))
1652 dst = os.path.join(self.src_dir, filename)
1653 os.symlink(self.src_file, dst)
1655 final_link = os.path.join(self.dst_dir, filename)
1656 self.assertTrue(os.path.islink(final_link))
1657 self.assertTrue(os.path.samefile(self.src_file, final_link))
1662 src = os.path.join(self.src_dir, 'baz')
1663 dst = os.path.join(self.src_dir, 'bar')
1664 os.symlink(src, dst)
1665 dst_link = os.path.join(self.dst_dir, 'quux')
1667 self.assertTrue(os.path.islink(dst_link))
1669 if os.name == 'nt':
1670 self.assertEqual(os.path.realpath(src), os.readlink(dst_link))
1672 self.assertEqual(os.path.realpath(src), os.path.realpath(dst_link))
1677 src = os.path.join(self.src_dir, 'baz')
1678 dst = os.path.join(self.src_dir, 'bar')
1679 os.mkdir(src)
1680 os.symlink(src, dst)
1681 dst_link = os.path.join(self.dst_dir, 'quux')
1683 self.assertTrue(os.path.islink(dst_link))
1684 self.assertTrue(os.path.samefile(src, dst_link))
1689 os.path.join(self.dst_dir, os.path.basename(self.src_file)))
1692 rv = shutil.move(self.src_file, os.path.join(self.dst_dir, 'bar'))
1693 self.assertEqual(rv, os.path.join(self.dst_dir, 'bar'))
1708 support.create_empty_file(os.path.join(self.src_dir, 'child'))
1709 support.create_empty_file(os.path.join(self.src_dir, 'child1'))
1823 dst_dir = os.path.join(
1824 os.path.dirname(self.src_dir),
1825 os.path.basename(self.src_dir).upper())
1830 self.assertTrue(os.path.isdir(dst_dir))
1832 os.rmdir(dst_dir)
1868 @unittest.skipUnless(os.isatty(sys.__stdout__.fileno()), "not on tty")
1869 @unittest.skipUnless(hasattr(os, 'get_terminal_size'),
1905 with open(os.devnull, 'w') as f, \
1925 if hasattr(os, 'statvfs') or os.name == 'nt':