mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
SF patch 695710: fix bug 678519: cStringIO self iterator
(requested by GvR. patch contributed by Michael Stone)
This commit is contained in:
parent
024aaa1bfe
commit
352f9477da
2 changed files with 59 additions and 68 deletions
|
@ -58,10 +58,10 @@ class TestGenericStringIO(unittest.TestCase):
|
|||
def test_iterator(self):
|
||||
eq = self.assertEqual
|
||||
unless = self.failUnless
|
||||
it = iter(self._fp)
|
||||
eq(iter(self._fp), self._fp)
|
||||
# Does this object support the iteration protocol?
|
||||
unless(hasattr(it, '__iter__'))
|
||||
unless(hasattr(it, 'next'))
|
||||
unless(hasattr(self._fp, '__iter__'))
|
||||
unless(hasattr(self._fp, 'next'))
|
||||
i = 0
|
||||
for line in self._fp:
|
||||
eq(line, self._line + '\n')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue