Lines Matching refs:file
74 """Write *content* to a file located at *path*.
77 make a path. If *binary* is true, the file will be opened in binary
88 """Create a test file with an arbitrary size and random text content."""
106 """Return contents from a file located at *path*.
109 make a path. If *binary* is true, the file will be opened in binary
288 # existing file
350 # a file in the directory, so the first time through
434 # When called on a file instead of a directory, don't delete it.
523 write_file((src_dir, 'file.txt'), 'foo')
526 os.symlink(os.path.join(src_dir, 'file.txt'),
537 # correctly refer to the file, but we're only comparing paths here.
540 self.assertEqual(actual, os.path.join(src_dir, 'file.txt'))
839 # file to file
934 # The modification times may be truncated in the new file.
1078 # Ensure that the copied file exists and has the same mode bits.
1110 # Ensure that the copied file exists and has the same mode and
1118 # The modification times may be truncated in the new file.
1151 # The modification times may be truncated in the new file.
1303 # Make sure file is not corrupted.
1309 # and is considered as a file.
1480 # check if ZIP file was created
1484 # now create another ZIP file using `zip`
1507 # check if ZIP file was created
1511 # now check the ZIP file using `unzip -t`
1589 register_archive_format('xxx', _breaks, [], 'xxx file')
1624 register_archive_format('xxx', lambda: x, [(1, 2)], 'xxx file')
1811 self.dir, self.file = os.path.split(self.temp_file.name)
1818 rv = shutil.which(self.file, path=self.dir)
1831 relpath = os.path.join(tail_dir, self.file)
1844 rv = shutil.which(self.file, path=base_dir)
1847 self.assertEqual(rv, os.path.join(self.curdir, self.file))
1854 # Set the file read-only and ask for writeable files.
1857 self.skipTest("can't set the file read-only")
1858 rv = shutil.which(self.file, path=self.dir, mode=os.W_OK)
1864 rv = shutil.which(self.file, path=tail_dir)
1865 self.assertEqual(rv, os.path.join(tail_dir, self.file))
1868 # Return None when no matching executable file is found on the path.
1875 # Ask for the file without the ".exe" extension, then ensure that
1877 rv = shutil.which(self.file[:-4], path=self.dir)
1883 rv = shutil.which(self.file)
1894 rv = shutil.which(self.file)
1911 rv = shutil.which(self.file)
1916 rv = shutil.which(self.file)
1927 rv = shutil.which(self.file)
1934 rv = shutil.which(self.file)
1942 rv = shutil.which(self.file, path='')
1948 rv = shutil.which(self.file)
1990 self.file = os.fsencode(self.file)
2022 # Move a file to another location on the same filesystem.
2026 # Move a file inside an existing dir on the same filesystem.
2030 # Move a pathlike file to another location on the same filesystem.
2035 # Move a file to another pathlike location on the same filesystem.
2041 # Move a file to an existing dir on another filesystem.
2046 # Move a file to another location on another filesystem.
2082 # A file with the same name inside the destination dir already exists.
2220 # Create a file and keep the directory immutable
2383 # If file size < 1 MiB memoryview() length must be equal to
2384 # the actual file size.
2456 # Make sure src file is not corrupted.
2548 # Emulate a case where src file size cannot be determined.
2558 # Force internal file size detection to be smaller than the
2559 # actual file size. We want to force sendfile() to be called
2571 # Force internal file size detection to be +100MB bigger than
2572 # the actual file size. Make sure sendfile() does not rely on
2573 # file size value except for (maybe) a better throughput /
2589 # Make sure file size and the block size arg passed to
2592 # ...unless we're dealing with a small file.
2602 # Emulate a case where sendfile() only support file->socket