Home
last modified time | relevance | path

Searched refs:TESTFN (Results 1 – 25 of 230) 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_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_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_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_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_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_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_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_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 …]
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_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 …]
/external/python/cpython3/Lib/test/
Dtest_posix.py23 support.TESTFN + '-dummy-symlink')
45 fp = open(support.TESTFN, 'w+')
47 self.teardown_files = [ support.TESTFN ]
156 fp = open(support.TESTFN)
166 fp = open(support.TESTFN, 'w+')
177 with open(support.TESTFN, 'w') as fp:
180 posix.truncate(support.TESTFN, 0)
271 fd = os.open(support.TESTFN, os.O_WRONLY | os.O_CREAT)
283 fd = os.open(support.TESTFN, os.O_RDWR | os.O_CREAT)
295 fd = os.open(support.TESTFN, os.O_RDWR | os.O_CREAT)
[all …]
Daudiotests.py1 from test.support import findfile, TESTFN, unlink
26 unlink(TESTFN)
71 f = self.create_file(TESTFN)
82 with self.module.open(TESTFN, 'wb'):
85 with open(TESTFN, 'wb') as testfile:
90 with open(TESTFN, 'wb') as testfile:
97 with open(TESTFN, 'rb') as testfile:
111 with self.module.open(TESTFN, 'wb') as f:
116 with self.module.open(TESTFN) as f:
126 f = self.create_file(TESTFN)
[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_largefile.py11 from test.support import TESTFN, requires, unlink, bigmemtest
19 TESTFN2 = TESTFN + '2'
25 if os.path.exists(TESTFN):
30 with self.open(TESTFN, mode) as f:
46 with cls.open(TESTFN, 'wb'):
48 if not os.stat(TESTFN)[stat.ST_SIZE] == 0:
64 with self.open(TESTFN, "rb") as f:
69 self.assertEqual(os.stat(TESTFN)[stat.ST_SIZE], size+1)
72 with self.open(TESTFN, 'rb') as f:
103 with self.open(TESTFN, 'rb') as f:
[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_zipfile.py22 from test.support import (TESTFN, findfile, unlink, rmtree, temp_dir, temp_cwd,
26 TESTFN2 = TESTFN + "2"
27 TESTFNDIR = TESTFN + "d"
55 with open(TESTFN, "wb") as fp:
62 zipfp.write(TESTFN, "another.name")
63 zipfp.write(TESTFN, TESTFN)
74 self.assertEqual(zipfp.read(TESTFN), self.data)
98 self.assertIn(TESTFN, names)
107 self.assertIn(TESTFN, names)
115 for nm in (TESTFN, "another.name", "strfile", "written-open-w"):
[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 with t.open(TESTFN, 'w') as f:
28 with open(TESTFN) as f:
34 with open(TESTFN, 'w') as f:
38 t.copy(TESTFN, TESTFN2)
45 with open(TESTFN, 'w') as f:
49 f = t.open(TESTFN, 'r')
58 with open(TESTFN, 'w') as f:
[all …]
Dtest_stat.py6 from test.support import TESTFN, import_fresh_module
80 os.remove(TESTFN)
83 os.rmdir(TESTFN)
88 def get_mode(self, fname=TESTFN, lstat=True):
114 with open(TESTFN, 'w'):
117 os.chmod(TESTFN, 0o700)
124 os.chmod(TESTFN, 0o070)
131 os.chmod(TESTFN, 0o007)
138 os.chmod(TESTFN, 0o444)
144 os.chmod(TESTFN, 0o700)
[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)
526 _testcapi.pymarshal_write_long_to_file(0x12345678, support.TESTFN, v)
527 with open(support.TESTFN, 'rb') as f:
529 support.unlink(support.TESTFN)
535 _testcapi.pymarshal_write_object_to_file(obj, support.TESTFN, v)
[all …]
Dtest_mmap.py1 from test.support import (TESTFN, import_module, unlink,
20 if os.path.exists(TESTFN):
21 os.unlink(TESTFN)
25 os.unlink(TESTFN)
33 f = open(TESTFN, 'bw+')
113 f = open(TESTFN, 'rb')
126 with open(TESTFN, "wb") as fp:
128 with open(TESTFN, "rb") as f:
175 with open(TESTFN, "rb") as fp:
180 with open(TESTFN, "r+b") as f:
[all …]
/external/python/cpython3/Lib/test/test_import/
D__init__.py23 TESTFN, forget, is_jython,
69 remove_files(TESTFN)
73 unload(TESTFN)
151 source = TESTFN + ext
153 pyc = TESTFN + "$py.class"
155 pyc = TESTFN + ".pyc"
165 if TESTFN in sys.modules:
166 del sys.modules[TESTFN]
170 mod = __import__(TESTFN)
179 forget(TESTFN)
[all …]

12345678910