Home
last modified time | relevance | path

Searched refs:TESTFN (Results 1 – 25 of 228) sorted by relevance

12345678910

/external/python/cpython2/Lib/test/
Dtest_marshal.py23 marshal.dump(expected, file(test_support.TESTFN, "wb"))
24 got = marshal.load(file(test_support.TESTFN, "rb"))
27 os.unlink(test_support.TESTFN)
58 marshal.dump(b, file(test_support.TESTFN, "wb"))
59 new = marshal.load(file(test_support.TESTFN, "rb"))
74 marshal.dump(f, file(test_support.TESTFN, "wb"))
75 got = marshal.load(file(test_support.TESTFN, "rb"))
101 marshal.dump(f, file(test_support.TESTFN, "wb"))
102 got = marshal.load(file(test_support.TESTFN, "rb"))
105 marshal.dump(f, file(test_support.TESTFN, "wb"), 1)
[all …]
Dtest_genericpath.py76 f = open(test_support.TESTFN, "wb")
80 self.assertEqual(self.pathmodule.getsize(test_support.TESTFN), 3)
84 test_support.unlink(test_support.TESTFN)
87 f = open(test_support.TESTFN, "wb")
91 f = open(test_support.TESTFN, "ab")
94 f = open(test_support.TESTFN, "rb")
100 self.pathmodule.getctime(test_support.TESTFN),
101 self.pathmodule.getmtime(test_support.TESTFN)
106 test_support.unlink(test_support.TESTFN)
109 self.assertIs(self.pathmodule.exists(test_support.TESTFN), False)
[all …]
Dtest_macos.py8 TESTFN2 = test_support.TESTFN + '2'
15 fp = open(test_support.TESTFN, 'w')
21 test_support.TESTFN])
23 cr, tp = MacOS.GetCreatorAndType(test_support.TESTFN)
28 os.unlink(test_support.TESTFN)
34 fp = open(test_support.TESTFN, 'w')
38 MacOS.SetCreatorAndType(test_support.TESTFN,
41 cr, tp = MacOS.GetCreatorAndType(test_support.TESTFN)
45 data = subprocess.Popen(["/Developer/Tools/GetFileInfo", test_support.TESTFN],
60 os.unlink(test_support.TESTFN)
[all …]
Dtest_zipfile.py21 from test.test_support import TESTFN, TESTFN_UNICODE, TESTFN_ENCODING, \
31 TESTFN2 = TESTFN + "2"
32 TESTFNDIR = TESTFN + "d"
50 with open(TESTFN, "wb") as fp:
56 zipfp.write(TESTFN, "another.name")
57 zipfp.write(TESTFN, TESTFN)
65 self.assertEqual(zipfp.read(TESTFN), self.data)
95 self.assertIn(TESTFN, names)
103 self.assertIn(TESTFN, names)
110 for nm in (TESTFN, "another.name", "strfile"):
[all …]
Dtest_import.py14 from test.test_support import (unlink, TESTFN, unload, run_unittest, rmtree,
42 unload(TESTFN)
63 source = TESTFN + ext
64 pyo = TESTFN + os.extsep + "pyo"
66 pyc = TESTFN + "$py.class"
68 pyc = TESTFN + os.extsep + "pyc"
79 mod = __import__(TESTFN)
98 unload(TESTFN)
119 fname = TESTFN + os.extsep + "py"
123 __import__(TESTFN)
[all …]
Dtest_fileio.py14 from test.test_support import TESTFN, check_warnings, run_unittest, make_bad_fd
24 self.f = _FileIO(TESTFN, 'w')
29 os.remove(TESTFN)
71 self.f = _FileIO(TESTFN, 'r')
79 self.f = _FileIO(TESTFN, 'rb')
87 self.f = _FileIO(TESTFN, 'rb')
98 self.f = _FileIO(TESTFN, 'r')
121 f = _FileIO(TESTFN, 'r')
252 self.f = _FileIO(TESTFN, 'r')
276 f = _FileIO(TESTFN, "w")
[all …]
Dtest_posixpath.py18 ABSTFN = abspath(test_support.TESTFN)
43 test_support.unlink(test_support.TESTFN + suffix)
44 safe_rmdir(test_support.TESTFN + suffix)
102 self.assertIs(posixpath.islink(test_support.TESTFN + "1"), False)
103 f = open(test_support.TESTFN + "1", "wb")
107 self.assertIs(posixpath.islink(test_support.TESTFN + "1"), False)
109 os.symlink(test_support.TESTFN + "1", test_support.TESTFN + "2")
110 self.assertIs(posixpath.islink(test_support.TESTFN + "2"), True)
111 os.remove(test_support.TESTFN + "1")
112 self.assertIs(posixpath.islink(test_support.TESTFN + "2"), True)
[all …]
Dtest_macostools.py13 TESTFN2 = test_support.TESTFN + '2'
20 fp = open(test_support.TESTFN, 'w')
23 rfp = MacOS.openrf(test_support.TESTFN, '*wb')
28 test_support.unlink(test_support.TESTFN)
32 fp = open(test_support.TESTFN, 'r')
40 rfp = MacOS.openrf(test_support.TESTFN, '*rb')
54 macostools.touched(test_support.TESTFN)
59 macostools.copy(test_support.TESTFN, TESTFN2)
65 macostools.mkalias(test_support.TESTFN, TESTFN2)
67 self.assertEqual(fss.as_pathname(), os.path.realpath(test_support.TESTFN))
[all …]
Dtest_file.py15 from test.support import TESTFN, run_unittest
23 self.f = self.open(TESTFN, 'wb')
28 support.unlink(TESTFN)
51 self.f = self.open(TESTFN, 'rb')
59 self.f = self.open(TESTFN, 'r')
68 self.f = self.open(TESTFN, 'rb')
91 self.assertEqual(f.name, TESTFN)
148 support.unlink(TESTFN)
152 self.open(TESTFN, 'wb').close()
155 f = self.open(TESTFN, mode)
[all …]
Dtest_posix.py22 test_support.TESTFN + '-dummy-symlink')
31 fp = open(test_support.TESTFN, 'w+')
33 self.teardown_files = [ test_support.TESTFN ]
139 fp = open(test_support.TESTFN)
148 fp = open(test_support.TESTFN, 'w+')
160 fp = open(test_support.TESTFN)
177 fp1 = open(test_support.TESTFN)
178 fp2 = open(test_support.TESTFN)
186 fd = os.open(test_support.TESTFN, os.O_RDONLY)
214 fd = os.open(test_support.TESTFN, os.O_RDONLY)
[all …]
Dtest_mmap.py1 from test.test_support import (TESTFN, run_unittest, import_module, unlink,
13 if os.path.exists(TESTFN):
14 os.unlink(TESTFN)
18 os.unlink(TESTFN)
26 f = open(TESTFN, 'w+')
105 f = open(TESTFN)
122 open(TESTFN, "wb").write("a"*mapsize)
123 f = open(TESTFN, "rb")
172 self.assertEqual(open(TESTFN, "rb").read(), 'a'*mapsize,
177 f = open(TESTFN, "r+b")
[all …]
Dtest_stat.py3 from test.test_support import TESTFN, run_unittest
53 os.remove(TESTFN)
56 os.rmdir(TESTFN)
61 def get_mode(self, fname=TESTFN, lstat=True):
86 with open(TESTFN, 'w'):
89 os.chmod(TESTFN, 0o700)
95 os.chmod(TESTFN, 0o070)
101 os.chmod(TESTFN, 0o007)
107 os.chmod(TESTFN, 0o444)
112 os.chmod(TESTFN, 0o700)
[all …]
Dtest_file2k.py18 from test.test_support import TESTFN, run_unittest, requires
25 self.f = open(TESTFN, 'wb')
30 os.remove(TESTFN)
63 self.f = open(TESTFN, 'rb')
72 self.f = open(TESTFN, 'rb')
96 self.f = open(TESTFN, 'rb')
102 self.assertTrue(repr(self.f).startswith("<open file '" + TESTFN))
113 self.f = open(TESTFN, 'rb')
115 self.assertEqual(f.name, TESTFN)
170 self.f = open(TESTFN, mode)
[all …]
Daudiotests.py1 from test.test_support import findfile, TESTFN, unlink
49 unlink(TESTFN)
91 f = self.create_file(TESTFN)
99 f = self.create_file(TESTFN)
104 self.check_file(TESTFN, self.nframes, self.frames)
107 with open(TESTFN, 'wb') as testfile:
114 with open(TESTFN, 'rb') as testfile:
119 with open(TESTFN, 'wb') as testfile:
128 with open(TESTFN, 'rb') as testfile:
133 with open(TESTFN, 'wb') as testfile:
[all …]
Dtest_pipes.py5 from test.test_support import TESTFN, run_unittest, unlink, reap_children
10 TESTFN2 = TESTFN + "2"
17 for f in (TESTFN, TESTFN2):
23 f = t.open(TESTFN, 'w')
26 with open(TESTFN) as f:
30 with open(TESTFN, 'w') as f:
34 t.copy(TESTFN, TESTFN2)
39 with open(TESTFN, 'w') as f:
43 with t.open(TESTFN, 'r') as f:
49 with open(TESTFN, 'w') as f:
[all …]
/external/python/cpython3/Lib/test/
Dtest_posix.py21 support.TESTFN + '-dummy-symlink')
42 fp = open(support.TESTFN, 'w+')
44 self.teardown_files = [ support.TESTFN ]
153 fp = open(support.TESTFN)
163 fp = open(support.TESTFN, 'w+')
174 with open(support.TESTFN, 'w') as fp:
177 posix.truncate(support.TESTFN, 0)
269 fd = os.open(support.TESTFN, os.O_WRONLY | os.O_CREAT)
281 fd = os.open(support.TESTFN, os.O_RDWR | os.O_CREAT)
293 fd = os.open(support.TESTFN, os.O_RDWR | os.O_CREAT)
[all …]
Daudiotests.py1 from test.support import findfile, TESTFN, unlink
27 unlink(TESTFN)
83 f = self.create_file(TESTFN)
94 with self.module.open(TESTFN, 'wb'):
97 with open(TESTFN, 'wb') as testfile:
102 with open(TESTFN, 'wb') as testfile:
109 with open(TESTFN, 'rb') as testfile:
123 with self.module.open(TESTFN, 'wb') as f:
128 with self.module.open(TESTFN) as f:
138 f = self.create_file(TESTFN)
[all …]
Dtest_zipfile.py17 from test.support import (TESTFN, findfile, unlink, rmtree, temp_dir, temp_cwd,
21 TESTFN2 = TESTFN + "2"
22 TESTFNDIR = TESTFN + "d"
53 with open(TESTFN, "wb") as fp:
60 zipfp.write(TESTFN, "another.name")
61 zipfp.write(TESTFN, TESTFN)
72 self.assertEqual(zipfp.read(TESTFN), self.data)
96 self.assertIn(TESTFN, names)
105 self.assertIn(TESTFN, names)
113 for nm in (TESTFN, "another.name", "strfile", "written-open-w"):
[all …]
Dtest_fileio.py12 from test.support import (TESTFN, TESTFN_UNICODE, check_warnings, run_unittest,
24 self.f = self.FileIO(TESTFN, 'w')
29 os.remove(TESTFN)
81 with self.FileIO(TESTFN, 'r') as f:
91 with self.FileIO(TESTFN, 'r') as f:
97 with self.FileIO(TESTFN, 'r') as f:
107 with self.FileIO(TESTFN, 'r') as f:
113 with self.FileIO(TESTFN, 'r') as f:
119 with self.FileIO(TESTFN, 'r') as f:
128 self.f = self.FileIO(TESTFN, 'rb')
[all …]
Dtest_file.py10 from test.support import TESTFN
18 self.f = self.open(TESTFN, 'wb')
23 support.unlink(TESTFN)
46 self.f = self.open(TESTFN, 'rb')
54 self.f = self.open(TESTFN, 'r')
63 self.f = self.open(TESTFN, 'rb')
86 self.assertEqual(f.name, TESTFN)
142 support.unlink(TESTFN)
146 self.open(TESTFN, 'wb').close()
149 f = self.open(TESTFN, mode)
[all …]
Dtest_marshal.py20 with open(support.TESTFN, "wb") as f:
22 with open(support.TESTFN, "rb") as f:
26 support.unlink(support.TESTFN)
291 with open(support.TESTFN, 'wb') as f:
297 with open(support.TESTFN, 'rb') as f:
304 support.unlink(support.TESTFN)
493 _testcapi.pymarshal_write_long_to_file(0x12345678, support.TESTFN, v)
494 with open(support.TESTFN, 'rb') as f:
496 support.unlink(support.TESTFN)
502 _testcapi.pymarshal_write_object_to_file(obj, support.TESTFN, v)
[all …]
Dtest_mmap.py1 from test.support import (TESTFN, run_unittest, import_module, unlink,
19 if os.path.exists(TESTFN):
20 os.unlink(TESTFN)
24 os.unlink(TESTFN)
32 f = open(TESTFN, 'bw+')
112 f = open(TESTFN, 'rb')
125 with open(TESTFN, "wb") as fp:
127 with open(TESTFN, "rb") as f:
174 with open(TESTFN, "rb") as fp:
179 with open(TESTFN, "r+b") as f:
[all …]
Dtest_pipes.py6 from test.support import TESTFN, run_unittest, unlink, reap_children
11 TESTFN2 = TESTFN + "2"
18 for f in (TESTFN, TESTFN2):
26 f = t.open(TESTFN, 'w')
29 with open(TESTFN) as f:
35 with open(TESTFN, 'w') as f:
39 t.copy(TESTFN, TESTFN2)
46 with open(TESTFN, 'w') as f:
50 f = t.open(TESTFN, 'r')
59 with open(TESTFN, 'w') as f:
[all …]
Dtest_largefile.py8 from test.support import TESTFN, requires, unlink, bigmemtest
21 if os.path.exists(TESTFN):
26 with self.open(TESTFN, mode) as f:
42 with cls.open(TESTFN, 'wb'):
44 if not os.stat(TESTFN)[stat.ST_SIZE] == 0:
53 with self.open(TESTFN, "rb") as f:
58 self.assertEqual(os.stat(TESTFN)[stat.ST_SIZE], size+1)
61 with self.open(TESTFN, 'rb') as f:
92 with self.open(TESTFN, 'rb') as f:
105 with self.open(TESTFN, 'r+b') as f:
[all …]
/external/python/cpython3/Lib/test/test_import/
D__init__.py23 EnvironmentVarGuard, TESTFN, check_warnings, forget, is_jython,
68 remove_files(TESTFN)
72 unload(TESTFN)
129 source = TESTFN + ext
131 pyc = TESTFN + "$py.class"
133 pyc = TESTFN + ".pyc"
143 if TESTFN in sys.modules:
144 del sys.modules[TESTFN]
148 mod = __import__(TESTFN)
157 forget(TESTFN)
[all …]

12345678910