Lines Matching refs:testfile

55     def create_file(self, testfile):
56 f = self.fout = self.module.open(testfile, 'wb')
63 def check_file(self, testfile, nframes, frames):
64 with self.module.open(testfile, 'rb') as f:
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:
97 self.assertEqual(testfile.closed, self.close_fd)
98 with open(TESTFN, 'rb') as testfile:
99 with self.module.open(testfile) as f:
107 self.assertEqual(testfile.closed, self.close_fd)
159 with open(TESTFN, 'wb') as testfile:
160 testfile.write(b'ababagalamaga')
161 f = self.create_file(testfile)
166 with open(TESTFN, 'rb') as testfile:
167 self.assertEqual(testfile.read(13), b'ababagalamaga')
168 self.check_file(testfile, self.nframes, self.frames)
171 with open(TESTFN, 'wb') as testfile:
172 testfile.write(b'ababagalamaga')
173 f = self.create_file(testfile)
180 with open(TESTFN, 'rb') as testfile:
181 self.assertEqual(testfile.read(13), b'ababagalamaga')
182 self.check_file(testfile, self.nframes, self.frames)
185 with open(TESTFN, 'wb') as testfile:
186 testfile.write(b'ababagalamaga')
187 f = self.create_file(testfile)
192 with open(TESTFN, 'rb') as testfile:
193 self.assertEqual(testfile.read(13), b'ababagalamaga')
194 self.check_file(testfile, self.nframes, self.frames)
201 with UnseekableIO(TESTFN, 'rb') as testfile:
202 self.check_file(testfile, self.nframes, self.frames)
205 with UnseekableIO(TESTFN, 'wb') as testfile:
206 with self.create_file(testfile) as f:
213 with UnseekableIO(TESTFN, 'wb') as testfile:
214 testfile.write(b'ababagalamaga')
215 f = self.create_file(testfile)
226 with open(TESTFN, 'rb') as testfile:
227 self.assertEqual(testfile.read(13), b'ababagalamaga')
228 self.check_file(testfile, self.nframes + 1, self.frames)
231 with UnseekableIO(TESTFN, 'wb') as testfile:
232 testfile.write(b'ababagalamaga')
233 f = self.create_file(testfile)
244 with open(TESTFN, 'rb') as testfile:
245 self.assertEqual(testfile.read(13), b'ababagalamaga')
247 self.check_file(testfile, self.nframes - 1, self.frames[:-framesize])
263 with open(self.sndfilepath, 'rb') as testfile:
264 f = self.f = self.module.open(testfile)
265 self.assertFalse(testfile.closed)
267 self.assertEqual(testfile.closed, self.close_fd)
268 with open(TESTFN, 'wb') as testfile:
269 fout = self.fout = self.module.open(testfile, 'wb')
270 self.assertFalse(testfile.closed)
273 self.assertEqual(testfile.closed, self.close_fd)
318 with open(TESTFN, 'wb') as testfile:
319 testfile.write(b'ababagalamaga')
321 testfile.write(f.read())
323 with open(TESTFN, 'rb') as testfile:
324 self.assertEqual(testfile.read(13), b'ababagalamaga')
325 with self.module.open(testfile, 'rb') as f: