Lines Matching refs:path
164 path = pathlib.Path(TESTFN2)
165 self.zip_open_test(path, self.compression)
166 with zipfile.ZipFile(path, "r", self.compression) as zipfp:
1310 def requiresWriteAccess(self, path):
1312 if not os.access(path, os.W_OK,
1315 filename = os.path.join(path, 'test_zipfile.try')
1324 self.requiresWriteAccess(os.path.dirname(__file__))
1338 bn = os.path.basename(fn)
1349 bn = "%s/%s" % ("testpackage", os.path.basename(fn))
1355 packagedir = os.path.dirname(email.__file__)
1369 packagedir = os.path.dirname(test.__file__)
1388 def filter(path):
1389 return not os.path.basename(path).startswith("bad")
1399 packagedir = os.path.dirname(email.__file__)
1415 with open(os.path.join(TESTFN2, "mod1.py"), "w", encoding='utf-8') as fp:
1418 with open(os.path.join(TESTFN2, "mod2.py"), "w", encoding='utf-8') as fp:
1421 with open(os.path.join(TESTFN2, "mod2.txt"), "w", encoding='utf-8') as fp:
1438 with open(os.path.join(TESTFN2, "mod1.py"), "w", encoding='utf-8') as fp:
1441 with open(os.path.join(TESTFN2, "mod2.py"), "w", encoding='utf-8') as fp:
1465 with open(os.path.join(TESTFN2, "mod1.py"), "w", encoding='utf-8') as fp:
1471 zipfp.writepy(os.path.join(TESTFN2, "mod1.py"))
1487 with open(os.path.join(TESTFN2, "mod1.py"), "w", encoding='utf-8') as fp:
1513 correctfile = os.path.join(os.getcwd(), fpath)
1514 correctfile = os.path.normpath(correctfile)
1531 correctfile = os.path.join(target, fpath)
1532 correctfile = os.path.normpath(correctfile)
1533 self.assertTrue(os.path.samefile(writtenfile, correctfile), (writtenfile, target))
1557 outfile = os.path.join(os.getcwd(), fpath)
1569 outfile = os.path.join(target, fpath)
1587 self.assertTrue(os.path.isfile(filename))
1611 @unittest.skipIf(os.path.sep != '\\', 'Requires \\ as path separator.')
1613 """Test combination of path fixing and windows name sanitization."""
1637 @unittest.skipIf(os.path.sep != '/', r'Requires / as path separator.')
1657 targetpath = os.path.join('target', 'subdir', 'subsub')
1658 correctfile = os.path.join(targetpath, *fixedname.split('/'))
1673 correctfile = os.path.join(os.getcwd(), *fixedname.split('/'))
1791 if os.path.exists(TESTFN):
1803 self.assertTrue(os.path.exists(TESTFN))
1829 # - passing a path-like object
2042 original_zip_size = os.path.getsize(TESTFN)
2045 self.assertTrue(original_zip_size > os.path.getsize(TESTFN))
2813 self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a")))
2814 self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a", "b")))
2815 self.assertTrue(os.path.exists(os.path.join(TESTFN2, "a", "b", "c")))
2819 os.mkdir(os.path.join(TESTFN2, "a"))
2823 dirpath = os.path.join(TESTFN2, "x")
2842 target = os.path.join(TESTFN2, "target")
2845 self.assertTrue(os.path.isdir(os.path.join(target, "y")))
2849 os.mkdir(os.path.join(TESTFN2, "x"))
2859 target = os.path.join(TESTFN2, "target")
2862 self.assertTrue(os.path.isdir(os.path.join(target, "x")))
2892 target = os.path.join(TESTFN2, "target")
2904 directory = os.path.join(TESTFN2, "directory2")
2912 target = os.path.join(TESTFN2, "target")
2920 if os.path.exists(TESTFN):
2929 self.assertEqual(zi.file_size, os.path.getsize(__file__))
2935 self.assertEqual(zi.file_size, os.path.getsize(__file__))
2941 self.assertEqual(zi.file_size, os.path.getsize(__file__))
2948 self.assertEqual(zi.file_size, os.path.getsize(__file__))
2951 dirpath = os.path.dirname(os.path.abspath(__file__))
3006 with open(os.path.join(TESTFNDIR, 'file.txt'), 'w', encoding='utf-8') as f:
3029 path = os.path.join(extdir,
3032 self.assertTrue(os.path.isdir(path))
3034 self.assertTrue(os.path.isfile(path))
3035 with open(path, 'rb') as f:
3175 path = tmpdir / alpharep.filename
3176 with path.open("wb") as strm:
3178 return path
3230 zf.writestr("path/16.txt", "This was utf-16".encode("utf-16"))
3233 (path,) = root.iterdir()
3234 u16 = path.joinpath("16.txt")
3245 zf.writestr("path/bad-utf8.bin", b"invalid utf-8: \xff\xff.")
3248 (path,) = root.iterdir()
3249 u16 = path.joinpath("bad-utf8.bin")
3273 zf.writestr("path/file.txt", b"Spanish Inquisition")
3275 (path,) = root.iterdir()
3276 file_path = path.joinpath("file.txt")
3367 zipfile.Path should be constructable from a path-like object
3509 The final path component, without its suffix
3717 os.stat(os.path.join(TESTFN2, fn))