mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Add error checks for the bz2, cStringIO and operator modules.
Add function names to various PyArg_ParseTuple calls in bz2module.c.
This commit is contained in:
parent
bc1d1b80d1
commit
bb9c739806
4 changed files with 112 additions and 4 deletions
|
@ -24,12 +24,14 @@ class TestGenericStringIO(unittest.TestCase):
|
|||
|
||||
def test_reads(self):
|
||||
eq = self.assertEqual
|
||||
self.assertRaises(TypeError, self._fp.seek)
|
||||
eq(self._fp.read(10), self._line[:10])
|
||||
eq(self._fp.readline(), self._line[10:] + '\n')
|
||||
eq(len(self._fp.readlines(60)), 2)
|
||||
|
||||
def test_writes(self):
|
||||
f = self.MODULE.StringIO()
|
||||
self.assertRaises(TypeError, f.seek)
|
||||
f.write(self._line[:6])
|
||||
f.seek(3)
|
||||
f.write(self._line[20:26])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue