Lines Matching defs:test
13 from test.support.script_helper import assert_python_ok
24 from test.support import script_helper
25 from test.support import (
29 from test.support.os_helper import (
44 def get_files(test):
48 test.assertFalse(f.closed)
51 test.assertFalse(f.closed)
56 cls.line_gen = [bytes("Zipfile test line %d. random float: %f\n" %
497 # NOTE: this test fails if len(d) < 22 because of the first
679 # These tests test the ZIP64 functionality without using large files,
760 # This test checks that more than 64k files can be added to an archive,
926 filename = b"test.txt"
977 This test mismatches the length of the zip64 extra field and the number
1093 # This test replicates the situation and reads the raw data to specifically ensure:
1102 # The relevent sections for this test are:
1165 # This test ensures that the zip will use a zip64 data descriptor (same
1170 # in as a zip, this test looks at the raw bytes created to ensure that
1173 # The relevent sections for this test are:
1263 w = zipf.open('test', 'w')
1269 self.assertEqual(zipf.read('test'), data)
1274 w = zipf.open('test', 'w')
1279 self.assertEqual(zipf.read('test'), data)
1368 import test
1369 packagedir = os.path.dirname(test.__file__)
1374 # first make sure that the test folder gives error messages
1593 # Passing pathsep in allows this test to work regardless of platform.
1809 # This test checks that the ZipFile constructor closes the file object
1923 f.write('zipfile test data')
2394 plain = b'zipfile.py encryption test'
2414 self.assertRaises(RuntimeError, self.zip.read, "test.txt")
2419 self.assertRaises(RuntimeError, self.zip.read, "test.txt")
2426 self.assertEqual(self.zip.read("test.txt"), self.plain)
2437 self.zip.read("test.txt", "python")
2440 self.zip.open("test.txt", pwd="python")
2443 self.zip.extract("test.txt", pwd="python")
2447 self.zip.open("test.txt")
2455 with self.zip.open("test.txt", "r") as fp:
2938 zi = zipfile.ZipInfo.from_file(os.fsencode(__file__), 'test')
2939 self.assertEqual(posixpath.basename(zi.filename), 'test')
2945 zi = zipfile.ZipInfo.from_file(f.fileno(), 'test')
2946 self.assertEqual(posixpath.basename(zi.filename), 'test')
2981 for opt in '-t', '--test':
3003 f.write('test 1')
3007 f.write('test 2')
3016 self.assertEqual(zf.read(namelist[0]), b'test 1')
3017 self.assertEqual(zf.read(namelist[2]), b'test 2')
3358 filename="(test)",