Lines Matching refs:testfile
66 def create_file(self, testfile): argument
67 f = self.fout = self.module.open(testfile, 'wb')
74 def check_file(self, testfile, nframes, frames): argument
75 with self.module.open(testfile, 'rb') as f:
97 with open(TESTFN, 'wb') as testfile:
98 with self.module.open(testfile):
102 with open(TESTFN, 'wb') as testfile:
103 with self.module.open(testfile) as f:
108 self.assertEqual(testfile.closed, self.close_fd)
109 with open(TESTFN, 'rb') as testfile:
110 with self.module.open(testfile) as f:
118 self.assertEqual(testfile.closed, self.close_fd)
170 with open(TESTFN, 'wb') as testfile:
171 testfile.write(b'ababagalamaga')
172 f = self.create_file(testfile)
177 with open(TESTFN, 'rb') as testfile:
178 self.assertEqual(testfile.read(13), b'ababagalamaga')
179 self.check_file(testfile, self.nframes, self.frames)
182 with open(TESTFN, 'wb') as testfile:
183 testfile.write(b'ababagalamaga')
184 f = self.create_file(testfile)
191 with open(TESTFN, 'rb') as testfile:
192 self.assertEqual(testfile.read(13), b'ababagalamaga')
193 self.check_file(testfile, self.nframes, self.frames)
196 with open(TESTFN, 'wb') as testfile:
197 testfile.write(b'ababagalamaga')
198 f = self.create_file(testfile)
203 with open(TESTFN, 'rb') as testfile:
204 self.assertEqual(testfile.read(13), b'ababagalamaga')
205 self.check_file(testfile, self.nframes, self.frames)
212 with UnseekableIO(TESTFN, 'rb') as testfile:
213 self.check_file(testfile, self.nframes, self.frames)
216 with UnseekableIO(TESTFN, 'wb') as testfile:
217 with self.create_file(testfile) as f:
224 with UnseekableIO(TESTFN, 'wb') as testfile:
225 testfile.write(b'ababagalamaga')
226 f = self.create_file(testfile)
237 with open(TESTFN, 'rb') as testfile:
238 self.assertEqual(testfile.read(13), b'ababagalamaga')
239 self.check_file(testfile, self.nframes + 1, self.frames)
242 with UnseekableIO(TESTFN, 'wb') as testfile:
243 testfile.write(b'ababagalamaga')
244 f = self.create_file(testfile)
255 with open(TESTFN, 'rb') as testfile:
256 self.assertEqual(testfile.read(13), b'ababagalamaga')
258 self.check_file(testfile, self.nframes - 1, self.frames[:-framesize])
274 with open(self.sndfilepath, 'rb') as testfile:
275 f = self.f = self.module.open(testfile)
276 self.assertFalse(testfile.closed)
278 self.assertEqual(testfile.closed, self.close_fd)
279 with open(TESTFN, 'wb') as testfile:
280 fout = self.fout = self.module.open(testfile, 'wb')
281 self.assertFalse(testfile.closed)
284 self.assertEqual(testfile.closed, self.close_fd)
329 with open(TESTFN, 'wb') as testfile:
330 testfile.write(b'ababagalamaga')
332 testfile.write(f.read())
334 with open(TESTFN, 'rb') as testfile:
335 self.assertEqual(testfile.read(13), b'ababagalamaga')
336 with self.module.open(testfile, 'rb') as f: