/third_party/python/Lib/test/ |
H A D | make_ssl_certs.py | 134 with open(req_file, 'w') as f: 163 with open(cert_file, 'r') as f: 165 with open(key_file, 'r') as f: 179 with open(os.path.join('cadir','index.txt'),'a+') as f: 181 with open(os.path.join('cadir','crl.txt'),'a+') as f: 183 with open(os.path.join('cadir','index.txt.attr'),'w+') as f: 186 with open(os.path.join('cadir','serial'), 'w') as f: 229 with open('ssl_cert.pem', 'w') as f: 231 with open('ssl_key.pem', 'w') as f: 237 with open('keycer [all...] |
H A D | test_dbm_dumb.py | 38 with contextlib.closing(dumbdbm.open(_fname, 'c')) as f: 49 f = dumbdbm.open(_fname, 'c', 0o637) 67 f = dumbdbm.open(_fname) 75 with contextlib.closing(dumbdbm.open(_fname, 'w')) as f: 84 with contextlib.closing(dumbdbm.open(_fname, 'r')) as f: 101 with contextlib.closing(dumbdbm.open(_fname)) as f: 105 with contextlib.closing(dumbdbm.open(_fname)) as f: 111 with contextlib.closing(dumbdbm.open(_fname)) as f: 114 with contextlib.closing(dumbdbm.open(_fname)) as f: 119 with contextlib.closing(dumbdbm.open(_fnam [all...] |
H A D | test_file.py | 20 self.f = self.open(TESTFN, 'wb') 49 self.f = self.open(TESTFN, 'rb') 57 self.f = self.open(TESTFN, encoding="utf-8") 66 self.f = self.open(TESTFN, 'rb') 136 open = io.open variable in CAutoFileTests 139 open = staticmethod(pyio.open) variable in PyAutoFileTests 149 self.open(TESTFN, 'wb').close() 152 f = self.open(TESTF 345 open = io.open global() variable in COtherFileTests 348 open = staticmethod(pyio.open) global() variable in PyOtherFileTests [all...] |
H A D | test_dbm_ndbm.py | 13 self.d = dbm.ndbm.open(self.filename, 'c') 21 self.d = dbm.ndbm.open(self.filename, 'c') 44 self.d = dbm.ndbm.open(self.filename, 'c') 57 self.d = dbm.ndbm.open(self.filename, mode) 63 with dbm.ndbm.open(self.filename, 'c') as db: 66 with dbm.ndbm.open(self.filename, 'r') as db: 75 with dbm.ndbm.open(self.filename, 'c') as db: 77 with dbm.ndbm.open(self.filename, 'r') as db: 83 with dbm.ndbm.open(self.filename, 'c') as db: 85 with dbm.ndbm.open(sel [all...] |
H A D | test_dbm_gnu.py | 33 self.g = gdbm.open(filename, 'c') 37 self.g = gdbm.open(filename, 'c') 62 # Try to open a non-existent database. 64 self.assertRaises(gdbm.error, gdbm.open, filename, 'r') 66 self.g = gdbm.open(filename, 'c') 69 # try pass an invalid open flag 70 self.assertRaises(gdbm.error, lambda: gdbm.open(filename, 'rx').close()) 73 # Test the flag parameter open() by trying all supported flag modes. 78 self.g = gdbm.open(filename, mode) 85 self.g = gdbm.open(filenam [all...] |
H A D | test_tarfile.py | 63 open = io.FileIO variable in TarTest 74 open = gzip.GzipFile if gzip else None variable in GzipTest 81 open = bz2.BZ2File if bz2 else None variable in Bz2Test 88 open = lzma.LZMAFile if lzma else None variable in LzmaTest 97 self.tar = tarfile.open(self.tarname, mode=self.mode, 118 with open(os.path.join(TEMPDIR, "ustar/regtype"), "r") as fobj1: 136 with open(os.path.join(TEMPDIR, "ustar/regtype"), "r") as fobj1: 146 with open(os.path.join(TEMPDIR, "ustar/regtype"), "rb") as fobj: 242 with tarfile.open(tmpname, 'w') as tar: 249 with tarfile.open(tmpnam 3306 def open(self, **kwargs): global() member in ArchiveMaker [all...] |
H A D | test_largefile.py | 31 with self.open(TESTFN, mode) as f: 47 with cls.open(TESTFN, 'wb'): 65 with self.open(TESTFN, "rb") as f: 73 with self.open(TESTFN, 'rb') as f: 104 with self.open(TESTFN, 'rb') as f: 117 with self.open(TESTFN, 'r+b') as f: 119 raise unittest.SkipTest("open().truncate() not available " 151 with self.open(TESTFN, 'rb') as f: 171 open = staticmethod(io.open) variable in TestCopyfile 190 open = staticmethod(io.open) global() variable in TestSocketSendfile 279 open = staticmethod(io.open) global() variable in CLargeFileTest 283 open = staticmethod(pyio.open) global() variable in PyLargeFileTest [all...] |
H A D | audiotests.py | 56 f = self.fout = self.module.open(testfile, 'wb') 64 with self.module.open(testfile, 'rb') as f: 83 with self.module.open(TESTFN, 'wb'): 86 with open(TESTFN, 'wb') as testfile: 87 with self.module.open(testfile): 91 with open(TESTFN, 'wb') as testfile: 92 with self.module.open(testfile) as f: 98 with open(TESTFN, 'rb') as testfile: 99 with self.module.open(testfile) as f: 112 with self.module.open(TESTF [all...] |
H A D | test_gzip.py | 154 # Write to a file, open it for reading, then close it. 323 with open(self.filename, 'rb') as fRead: 387 with open(self.filename, 'rb') as fRead: 418 with open(self.filename, "ab") as f: 429 with open(self.filename, 'wb') as file: 477 fd = os.open(self.filename, os.O_WRONLY | os.O_CREAT) 484 with open(self.filename, "r+b") as f: 496 with open(self.filename, mode) as f: 502 with open(self.filename, mode) as f: 606 with gzip.open(sel [all...] |
H A D | test_aifc.py | 155 f = aifc.open(findfile('Sine-1000Hz-300ms.aif')) 163 # `aifc.open` will fail (without raising a ResourceWarning) 164 self.f = aifc.open(non_aifc_file, 'rb') 171 self.fout = aifc.open(TESTFN, 'wb') 174 f = self.f = aifc.open(TESTFN, 'wb') 179 f = aifc.open(TESTFN, 'rb') 191 fout = aifc.open(io.BytesIO(), 'wb') 200 fout = aifc.open(io.BytesIO(), 'wb') 209 fout = self.fout = aifc.open(TESTFN, 'wb') 216 f = aifc.open(TESTF [all...] |
H A D | test_pdb.py | 1732 with open(filename, 'w') as f: 1744 with open(init_file, 'w') as f: 1746 with open(main_file, 'w') as f: 1752 with open(os_helper.TESTFN, 'wb') as f: 1807 # open the file as binary so we can force \r\n newline 1808 with open(os_helper.TESTFN, 'wb') as f: 1870 with open('bar.py', 'w') as f: 1882 with open(os_helper.TESTFN, 'wb') as f: 1908 with open(os_helper.TESTFN, 'wb') as f: 1973 with open(' [all...] |
H A D | test_dbm.py | 1 """Test script for the dbm.open function based on testdumbdbm.py""" 23 mod = __import__(name, fromlist=['open']) 50 f = dbm.open(_fname, 'n') 65 self.assertRaises(dbm.error, dbm.open, _fname) 68 f = dbm.open(_fname, 'c') 78 with dbm.open(_fname, 'n') as f: 83 f = dbm.open(_fname, 'c') 93 f = dbm.open(_fname, 'r') 105 f = dbm.open(_fname, 'r') 113 f = dbm.open(_fnam [all...] |
H A D | test_pipes.py | 33 with t.open(TESTFN, 'w') as f: 35 with open(TESTFN) as f: 41 with open(TESTFN, 'w') as f: 46 with open(TESTFN2) as f: 52 with open(TESTFN, 'w') as f: 56 f = t.open(TESTFN, 'r') 65 with open(TESTFN, 'w') as f: 67 with open(TESTFN2, 'w') as f: 71 with open(TESTFN2) as f: 77 with open(TESTF [all...] |
H A D | test_imghdr.py | 40 with open(cls.testfile, 'rb') as stream: 50 with open(filename, 'rb') as stream: 52 with open(filename, 'rb') as stream: 72 with open(TESTFN, 'wb') as stream: 76 with open(TESTFN, 'rb') as stream: 90 with open(self.testfile, 'rb') as f: 108 with open(filename, 'rb') as stream: 120 stream = open(self.testfile, 'rb') 130 with open(TESTFN, 'wb') as stream: 137 with open(TESTF [all...] |
H A D | test_univnewlines.py | 36 open = io.open variable in CTest 39 open = staticmethod(pyio.open) variable in PyTest 51 with self.open(os_helper.TESTFN, self.WRITEMODE) as fp: 61 with self.open(os_helper.TESTFN, self.READMODE) as fp: 67 with self.open(os_helper.TESTFN, self.READMODE) as fp: 73 with self.open(os_helper.TESTFN, self.READMODE) as fp: 83 with self.open(os_helper.TESTFN, self.READMODE) as fp: 110 with self.open(os_helpe [all...] |
/third_party/ltp/testcases/kernel/security/tomoyo/ |
H A D | tomoyo_rewrite_test.c | 66 set_profile(3, "file::open"); in stage_rewrite_test() 71 close(open(REWRITE_PATH, O_WRONLY | O_APPEND | O_CREAT, 0600)); in stage_rewrite_test() 76 show_prompt("open(O_RDONLY)"); in stage_rewrite_test() 77 fd = open(REWRITE_PATH, O_RDONLY); in stage_rewrite_test() 81 show_prompt("open(O_WRONLY | O_APPEND)"); in stage_rewrite_test() 82 fd = open(REWRITE_PATH, O_WRONLY | O_APPEND); in stage_rewrite_test() 87 show_prompt("open(O_WRONLY)"); in stage_rewrite_test() 88 fd = open(REWRITE_PATH, O_WRONLY); in stage_rewrite_test() 92 show_prompt("open(O_WRONLY | O_TRUNC)"); in stage_rewrite_test() 93 fd = open(REWRITE_PAT in stage_rewrite_test() [all...] |
H A D | tomoyo_new_test.c | 50 result = open("/etc/fstab", O_RDONLY); in test_read_etc_fstab() 55 result = open("/dev/null", O_WRONLY); in test_write_dev_null() 141 int fd = open("/dev/null", O_RDWR); in test_ioctl_dev_null() 200 result = open("/tmp/testfile0", O_RDONLY, 0600); in test_file_open_0() 205 result = open("/tmp/testfile1", O_CREAT | O_RDONLY, 0600); in test_file_open_1() 210 result = open("/tmp/testfile2", O_TRUNC | O_RDONLY, 0600); in test_file_open_2() 215 result = open("/tmp/testfile3", O_TRUNC | O_CREAT | O_RDONLY, 0600); in test_file_open_3() 220 result = open("/tmp/testfile4", O_APPEND | O_RDONLY, 0600); in test_file_open_4() 225 result = open("/tmp/testfile5", O_APPEND | O_CREAT | O_RDONLY, 0600); in test_file_open_5() 230 result = open("/tm in test_file_open_6() [all...] |
H A D | tomoyo_new_file_test.c | 52 set_profile(0, "file::open"); in create2() 55 set_profile(3, "file::open"); in create2() 103 set_profile(3, "file::open"); in stage_file_test() 190 fd = open("/dev/null", O_RDONLY); in stage_file_test() 195 fd = open("/dev/null", O_RDONLY); in stage_file_test() 202 fd = open("/dev/null", O_RDONLY); in stage_file_test() 207 fd = open("/dev/null", O_RDONLY); in stage_file_test() 214 fd = open("/dev/null", O_RDONLY); in stage_file_test() 219 fd = open("/dev/null", O_RDONLY); in stage_file_test() 226 fd = open("/de in stage_file_test() [all...] |
/third_party/musl/libc-test/src/functionalext/trace/ |
H A D | trace_marker.c | 83 int out_fd = open(OUTFILE, O_WRONLY | O_CREAT, TEST_MODE); in dump_trace() 110 int trace_fd = open("/sys/kernel/tracing/trace", O_CLOEXEC | O_RDONLY); in trace_marker_0010() 112 trace_fd = open("/sys/kernel/debug/tracing/trace", O_CLOEXEC | O_RDONLY); in trace_marker_0010() 161 int trace_fd = open("/sys/kernel/tracing/trace", O_CLOEXEC | O_RDONLY); in trace_marker_0020() 163 trace_fd = open("/sys/kernel/debug/tracing/trace", O_CLOEXEC | O_RDONLY); in trace_marker_0020() 212 int trace_fd = open("/sys/kernel/tracing/trace", O_CLOEXEC | O_RDONLY); in trace_marker_0030() 214 trace_fd = open("/sys/kernel/debug/tracing/trace", O_CLOEXEC | O_RDONLY); in trace_marker_0030() 270 int trace_fd = open("/sys/kernel/tracing/trace", O_CLOEXEC | O_RDONLY | O_APPEND); in trace_marker_0040() 272 trace_fd = open("/sys/kernel/debug/tracing/trace", O_CLOEXEC | O_RDONLY | O_APPEND); in trace_marker_0040() 308 int trace_fd = open("/sy in trace_marker_0040() [all...] |
/third_party/libsnd/ |
H A D | make_lite.py | 116 source_code = open (filename, 'r').read () 121 open (filename, 'w').write (source_code) 124 source_code = open (filename, 'r').read () 128 open (filename, 'w').write (source_code) 131 source_code = open (filename, 'r').read () 135 open (filename, 'w').write (source_code) 138 source_code = open (filename, 'r').read () 142 open (filename, 'w').write (source_code) 145 source_code = open (filename, 'r').read () 149 open (filenam [all...] |
/third_party/node/test/parallel/ |
H A D | test-fs-promises-file-handle-writeFile.js | 9 const { open, writeFile } = fs.promises; 20 const fileHandle = await open(filePathForHandle, 'w+'); 35 const fileHandle = await open(filePathForHandle, 'w+'); 86 const fileHandle = await open(dest, 'w+'); 101 const fileHandle = await open(otherDest, 'w+'); 113 const fileHandle = await open(dest, 'w+'); 124 const fileHandle = await open(dest, 'w+'); 140 const fileHandle = await open(dest, 'w+'); 152 const fileHandle = await open(dest, 'w+'); 163 const fileHandle = await open(des [all...] |
/third_party/python/Lib/dbm/ |
H A D | __init__.py | 6 d = dbm.open(file, 'w', 0o666) 30 __all__ = ['open', 'whichdb', 'error'] 53 def open(file, flag='r', mode=0o666): function 68 mod = __import__(name, fromlist=['open']) 95 return mod.open(file, flag, mode) 99 """Guess which db package to use to open a db file. 114 f = io.open(filename + b".pag", "rb") 116 f = io.open(filename + b".dir", "rb") 123 f = io.open(filename + b".db", "rb") 125 # guarantee we can actually open th [all...] |
/third_party/musl/libc-test/src/functionalext/supplement/fcntl/ |
H A D | open.c | 25 * @tc.desc : Verify file open mode is O_RDONLY 32 int fd = open(path, O_RDONLY + O_CREAT, TEST_MODE); in open_0100() 45 * @tc.desc : Verify file open mode is O_RDONLY (file does not exist) 50 int fd = open(path, O_RDONLY); in open_0200() 56 * @tc.desc : Verify file open mode is O_WRONLY 63 int fd = open(path, O_WRONLY + O_CREAT, TEST_MODE); in open_0300() 75 * @tc.desc : Verify file open mode is O_WRONLY(file does not exist) 80 int fd = open(path, O_WRONLY); in open_0400() 86 * @tc.desc : Verify file open mode is O_RDWR | O_APPEND 93 int fd = open(pat in open_0500() [all...] |
/third_party/python/Lib/test/test_importlib/ |
H A D | test_open.py | 11 with target.open('rb'): 18 with target.open(): 25 with target.open('rb') as fp: 31 with target.open() as fp: 37 with target.open(encoding='utf-16', errors='strict') as fp: 44 with target.open(encoding='utf-8', errors='strict') as fp: 46 with target.open(encoding='utf-8', errors='ignore') as fp: 57 self.assertRaises(FileNotFoundError, target.open, 'rb') 61 self.assertRaises(FileNotFoundError, target.open)
|
/third_party/musl/libc-test/src/functionalext/supplement/unistd/ |
H A D | faccessat.c | 35 int fd = open(ptr, O_RDWR | O_CREAT, TEST_MODE); in faccessat_0100() 68 int fd = open(ptr, O_RDWR | O_CREAT, 00040); in faccessat_0300() 85 int fd = open(ptr, O_RDWR | O_CREAT, 00020); in faccessat_0400() 102 int fd = open(ptr, O_RDWR | O_CREAT, 00010); in faccessat_0500() 122 int fd = open(ptr, O_RDWR | O_CREAT, TEST_MODE); in faccessat_0600() 139 int fd = open(ptr, O_RDWR | O_CREAT, 00070); in faccessat_0700() 156 int fd = open(ptr, O_RDWR | O_CREAT, TEST_MODE); in faccessat_0800() 173 int fd = open(ptr, O_RDWR | O_CREAT, 00070); in faccessat_0900() 192 int fd = open(ptr, O_RDWR | O_CREAT, 00070); in faccessat_1000() 210 int fd = open(pt in faccessat_1100() [all...] |