Lines Matching full:join
76 If *path* is a tuple instead of a string, os.path.join will be used to
81 path = os.path.join(*path)
98 chunk = b"".join([random.choice(string.ascii_letters).encode()
108 If *path* is a tuple instead of a string, os.path.join will be used to
113 path = os.path.join(*path)
122 p = os.path.join(path, name)
191 victim = os.path.join(tmp, 'killme')
193 write_file(os.path.join(victim, 'somefile'), 'foo')
201 dir_ = os.path.join(tmp, 'dir')
203 link = os.path.join(tmp, 'link')
220 dir1 = os.path.join(tmp, 'dir1')
221 dir2 = os.path.join(dir1, 'dir2')
222 dir3 = os.path.join(tmp, 'dir3')
225 file1 = os.path.join(tmp, 'file1')
227 link1 = os.path.join(dir1, 'link1')
229 link2 = os.path.join(dir1, 'link2')
231 link3 = os.path.join(dir1, 'link3')
242 dir_ = os.path.join(tmp, 'dir')
244 link = os.path.join(tmp, 'link')
262 dir1 = os.path.join(tmp, 'dir1')
263 dir2 = os.path.join(dir1, 'dir2')
264 dir3 = os.path.join(tmp, 'dir3')
267 file1 = os.path.join(tmp, 'file1')
269 link1 = os.path.join(dir1, 'link1')
271 link2 = os.path.join(dir1, 'link2')
273 link3 = os.path.join(dir1, 'link3')
291 filename = os.path.join(tmpdir, "tstfile")
323 self.child_file_path = os.path.join(TESTFN, 'a')
324 self.child_dir_path = os.path.join(TESTFN, 'b')
397 d = os.path.join(tmp_dir, 'a')
416 fullname = os.path.join(tmp_dir, victim)
420 os.mkdir(os.path.join(fullname, 'subdir'))
421 write_file(os.path.join(fullname, 'subdir', 'somefile'), 'foo')
445 src = os.path.join(TESTFN, 'cheese')
446 dst = os.path.join(TESTFN, 'shop')
458 src = os.path.join(TESTFN, 'cheese')
459 dst = os.path.join(TESTFN, 'shop')
461 open(os.path.join(src, 'spam'), 'wb').close()
473 dst_dir = os.path.join(self.mkdtemp(), 'destination')
477 os.mkdir(os.path.join(src_dir, 'test_dir'))
481 self.assertTrue(os.path.isfile(os.path.join(dst_dir, 'test.txt')))
482 self.assertTrue(os.path.isdir(os.path.join(dst_dir, 'test_dir')))
483 self.assertTrue(os.path.isfile(os.path.join(dst_dir, 'test_dir',
497 os.mkdir(os.path.join(src_dir, 'existing_dir'))
498 os.mkdir(os.path.join(dst_dir, 'existing_dir'))
503 self.assertTrue(os.path.isfile(os.path.join(dst_dir, 'nonexisting.txt')))
504 self.assertTrue(os.path.isdir(os.path.join(dst_dir, 'existing_dir')))
505 self.assertTrue(os.path.isfile(os.path.join(dst_dir, 'existing_dir',
518 src_dir = os.path.join(tmp_dir, 'src')
519 dst_dir = os.path.join(tmp_dir, 'dst')
520 sub_dir = os.path.join(src_dir, 'sub')
524 src_link = os.path.join(sub_dir, 'link')
525 dst_link = os.path.join(dst_dir, 'sub/link')
526 os.symlink(os.path.join(src_dir, 'file.txt'),
534 self.assertTrue(os.path.islink(os.path.join(dst_dir, 'sub', 'link')))
535 actual = os.readlink(os.path.join(dst_dir, 'sub', 'link'))
540 self.assertEqual(actual, os.path.join(src_dir, 'file.txt'))
549 join = os.path.join
553 dst_dir = join(self.mkdtemp(), 'destination')
556 os.mkdir(join(src_dir, 'test_dir'))
558 os.mkdir(join(src_dir, 'test_dir2'))
560 os.mkdir(join(src_dir, 'test_dir2', 'subdir'))
561 os.mkdir(join(src_dir, 'test_dir2', 'subdir2'))
570 self.assertTrue(exists(join(dst_dir, 'test.txt')))
571 self.assertFalse(exists(join(dst_dir, 'test.tmp')))
572 self.assertFalse(exists(join(dst_dir, 'test_dir2')))
579 self.assertFalse(exists(join(dst_dir, 'test.tmp')))
580 self.assertFalse(exists(join(dst_dir, 'test_dir2', 'subdir2')))
581 self.assertFalse(exists(join(dst_dir, 'test_dir2', 'subdir')))
590 path = os.path.join(src, name)
602 self.assertFalse(exists(join(dst_dir, 'test_dir2', 'subdir2',
604 self.assertFalse(exists(join(dst_dir, 'test_dir2', 'subdir')))
613 join = os.path.join
617 src_dir = join(tmp_dir, "source")
619 os.mkdir(join(src_dir))
620 os.mkdir(join(src_dir, 'test_dir'))
621 os.mkdir(os.path.join(src_dir, 'test_dir', 'subdir'))
635 dst_dir = join(self.mkdtemp(), 'destination')
637 self.assertTrue(exists(join(dst_dir, 'test_dir', 'subdir',
640 dst_dir = join(self.mkdtemp(), 'destination')
642 self.assertTrue(exists(join(dst_dir, 'test_dir', 'subdir',
645 dst_dir = join(self.mkdtemp(), 'destination')
649 self.assertTrue(exists(join(dst_dir, 'test_dir', 'subdir',
656 src_dir = os.path.join(tmp_dir, 'source')
658 dst_dir = os.path.join(tmp_dir, 'destination')
663 os.chmod(os.path.join(src_dir, 'permissive.txt'), 0o777)
665 os.chmod(os.path.join(src_dir, 'restrictive.txt'), 0o600)
672 self.assertEqual(os.stat(os.path.join(src_dir, 'permissive.txt')).st_mode,
673 os.stat(os.path.join(dst_dir, 'permissive.txt')).st_mode)
674 self.assertEqual(os.stat(os.path.join(src_dir, 'restrictive.txt')).st_mode,
675 os.stat(os.path.join(dst_dir, 'restrictive.txt')).st_mode)
676 restrictive_subdir_dst = os.path.join(dst_dir,
687 dst_dir = os.path.join(self.mkdtemp(), 'destination')
701 self.assertEqual(a, os.path.join(src, 'foo'))
702 self.assertEqual(b, os.path.join(dst, 'foo'))
707 with open(os.path.join(src, 'foo'), 'w', encoding='utf-8') as f:
720 subdir = os.path.join(TESTFN, "subdir")
722 pipe = os.path.join(subdir, "mypipe")
742 dst_dir = os.path.join(self.mkdtemp(), 'destination')
744 os.mkdir(os.path.join(src_dir, 'test_dir'))
757 valid_file = os.path.join(src_dir, 'test.txt')
759 dir_a = os.path.join(src_dir, 'dir_a')
762 os.symlink('IDONTEXIST', os.path.join(d, 'broken'))
763 os.symlink(valid_file, os.path.join(d, 'valid'))
766 dst_dir = os.path.join(self.mkdtemp(), 'destination')
770 dst_dir = os.path.join(self.mkdtemp(), 'destination2')
777 dst_dir = os.path.join(self.mkdtemp(), 'destination3')
784 dst_dir = os.path.join(self.mkdtemp(), 'destination')
785 os.mkdir(os.path.join(src_dir, 'real_dir'))
786 with open(os.path.join(src_dir, 'real_dir', 'test.txt'), 'wb'):
788 os.symlink(os.path.join(src_dir, 'real_dir'),
789 os.path.join(src_dir, 'link_to_dir'),
793 self.assertFalse(os.path.islink(os.path.join(dst_dir, 'link_to_dir')))
794 self.assertIn('test.txt', os.listdir(os.path.join(dst_dir, 'link_to_dir')))
796 dst_dir = os.path.join(self.mkdtemp(), 'destination2')
798 self.assertTrue(os.path.islink(os.path.join(dst_dir, 'link_to_dir')))
799 self.assertIn('test.txt', os.listdir(os.path.join(dst_dir, 'link_to_dir')))
806 src = os.path.join(src_dir, 'foo')
815 src_dir = os.path.join(base_dir, "t", "pg")
816 dst_dir = os.path.join(src_dir, "somevendor", "1.0")
818 src = os.path.join(src_dir, 'pol')
830 src = os.path.join(tmp_dir, 'foo')
831 dst = os.path.join(tmp_dir, 'bar')
832 src_link = os.path.join(tmp_dir, 'baz')
833 dst_link = os.path.join(tmp_dir, 'quux')
863 src = os.path.join(tmp_dir, 'foo')
864 dst = os.path.join(tmp_dir, 'bar')
865 src_link = os.path.join(tmp_dir, 'baz')
866 dst_link = os.path.join(tmp_dir, 'quux')
893 src = os.path.join(tmp_dir, 'foo')
894 dst = os.path.join(tmp_dir, 'bar')
895 src_link = os.path.join(tmp_dir, 'baz')
896 dst_link = os.path.join(tmp_dir, 'quux')
908 src = os.path.join(tmp_dir, 'foo')
909 dst = os.path.join(tmp_dir, 'bar')
910 src_link = os.path.join(tmp_dir, 'baz')
911 dst_link = os.path.join(tmp_dir, 'qux')
952 file1 = os.path.join(tmpdir, 'file1')
953 file2 = os.path.join(tmpdir, 'file2')
980 src = os.path.join(tmp_dir, 'foo')
982 dst = os.path.join(tmp_dir, 'bar')
1025 src = os.path.join(tmp_dir, 'the_original')
1026 srcro = os.path.join(tmp_dir, 'the_original_ro')
1032 dst = os.path.join(tmp_dir, 'the_copy')
1033 dstro = os.path.join(tmp_dir, 'the_copy_ro')
1049 src = os.path.join(tmp_dir, 'foo')
1050 src_link = os.path.join(tmp_dir, 'baz')
1055 dst = os.path.join(tmp_dir, 'bar')
1056 dst_link = os.path.join(tmp_dir, 'qux')
1071 file1 = os.path.join(tmpdir, fname)
1074 file2 = os.path.join(tmpdir2, fname)
1086 src = os.path.join(tmp_dir, 'foo')
1087 dst = os.path.join(tmp_dir, 'bar')
1088 src_link = os.path.join(tmp_dir, 'baz')
1128 src = os.path.join(tmp_dir, 'foo')
1129 dst = os.path.join(tmp_dir, 'bar')
1130 src_link = os.path.join(tmp_dir, 'baz')
1163 src = os.path.join(tmp_dir, 'foo')
1164 dst = os.path.join(tmp_dir, 'bar')
1178 src = os.path.join(src_dir, 'foo')
1181 self.assertEqual(rv, os.path.join(dst_dir, 'foo'))
1182 rv = fn(src, os.path.join(dst_dir, 'bar'))
1183 self.assertEqual(rv, os.path.join(dst_dir, 'bar'))
1193 src_file = os.path.join(src_dir, 'foo')
1195 dst = os.path.join(src_dir, 'does_not_exist/')
1212 src = os.path.join(tmp_dir, 'src')
1213 dst = os.path.join(tmp_dir, 'dst')
1214 dst_link = os.path.join(tmp_dir, 'dst_link')
1215 link = os.path.join(tmp_dir, 'link')
1230 src = os.path.join(TESTFN, 'cheese')
1231 dst = os.path.join(TESTFN, 'shop')
1250 src = os.path.join(TESTFN, 'cheese')
1251 dst = os.path.join(TESTFN, 'shop')
1287 dst_file = os.path.join(dst_dir, 'bar')
1288 src_file = os.path.join(src_dir, 'foo')
1298 src_file = os.path.join(src_dir, 'foo')
1314 src_file = os.path.join(src_dir, 'foo')
1315 dst = os.path.join(src_dir, 'does_not_exist/')
1324 src_file = os.path.join(src_dir, 'foo')
1326 dst = os.path.join(src_dir, 'does_not_exist/')
1352 rel_base_name = os.path.join(os.path.basename(tmpdir2), 'archive')
1387 dist = os.path.join(root_dir, base_dir)
1391 os.mkdir(os.path.join(dist, 'sub'))
1393 os.mkdir(os.path.join(dist, 'sub2'))
1403 base_name = os.path.join(self.mkdtemp(), 'archive')
1412 tarball2 = os.path.join(root_dir, 'archive2.tar')
1444 rel_base_name = os.path.join(os.path.basename(tmpdir2), 'archive')
1476 base_name = os.path.join(self.mkdtemp(), 'archive')
1485 archive2 = os.path.join(root_dir, 'archive2.zip')
1503 base_name = os.path.join(self.mkdtemp(), 'archive')
1525 base_name = os.path.join(tmpdir, 'archive')
1539 base_name = os.path.join(self.mkdtemp(), 'archive')
1560 base_name = os.path.join(self.mkdtemp(), 'archive')
1646 base_name = os.path.join(self.mkdtemp(), 'archive')
1831 relpath = os.path.join(tail_dir, self.file)
1847 self.assertEqual(rv, os.path.join(self.curdir, self.file))
1865 self.assertEqual(rv, os.path.join(tail_dir, self.file))
1903 expected_cwd = os.path.join(curdir, expected_cwd)
2002 self.src_file = os.path.join(self.src_dir, filename)
2003 self.dst_file = os.path.join(self.dst_dir, filename)
2065 os.path.join(self.dst_dir, os.path.basename(self.src_dir)))
2074 os.path.join(self.dst_dir, os.path.basename(self.src_dir)))
2079 os.path.join(self.dst_dir, os.path.basename(self.src_dir)))
2089 dst = os.path.join(self.src_dir, "bar")
2096 src = os.path.join(TESTFN, src)
2097 dst = os.path.join(TESTFN, dst)
2108 src = os.path.join(TESTFN, src)
2109 dst = os.path.join(TESTFN, dst)
2119 dst = os.path.join(self.src_dir, 'bar')
2129 dst = os.path.join(self.src_dir, filename)
2132 final_link = os.path.join(self.dst_dir, filename)
2139 src = os.path.join(self.src_dir, 'baz')
2140 dst = os.path.join(self.src_dir, 'bar')
2142 dst_link = os.path.join(self.dst_dir, 'quux')
2150 src = os.path.join(self.src_dir, 'baz')
2151 dst = os.path.join(self.src_dir, 'bar')
2154 dst_link = os.path.join(self.dst_dir, 'quux')
2162 os.path.join(self.dst_dir, os.path.basename(self.src_file)))
2165 rv = shutil.move(self.src_file, os.path.join(self.dst_dir, 'bar'))
2166 self.assertEqual(rv, os.path.join(self.dst_dir, 'bar'))
2181 os_helper.create_empty_file(os.path.join(self.src_dir, 'child'))
2182 os_helper.create_empty_file(os.path.join(self.src_dir, 'child1'))
2191 dst_dir = os.path.join(
2222 os_helper.create_empty_file(os.path.join(TESTFN_SRC, 'child'))