diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2010-01-31 23:20:26 (GMT) |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-01-31 23:20:26 (GMT) |
| commit | 66f9fea782d330b28fe142ac4e58faff8a6f42d1 (patch) | |
| tree | 664127f167fb8d906cf7f7de7d1e1557fea0e647 /Lib/test/test_memoryio.py | |
| parent | 1665a8d9313660ffdcf3eda3eb1e1cc4eefcacee (diff) | |
| download | cpython-66f9fea782d330b28fe142ac4e58faff8a6f42d1.zip cpython-66f9fea782d330b28fe142ac4e58faff8a6f42d1.tar.gz cpython-66f9fea782d330b28fe142ac4e58faff8a6f42d1.tar.bz2 | |
Merged revisions 77895-77896 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r77895 | antoine.pitrou | 2010-01-31 23:47:27 +0100 (dim., 31 janv. 2010) | 12 lines
Merged revisions 77890 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77890 | antoine.pitrou | 2010-01-31 23:26:04 +0100 (dim., 31 janv. 2010) | 7 lines
- Issue #6939: Fix file I/O objects in the `io` module to keep the original
file position when calling `truncate()`. It would previously change the
file position to the given argument, which goes against the tradition of
ftruncate() and other truncation APIs. Patch by Pascal Chambon.
........
................
r77896 | antoine.pitrou | 2010-02-01 00:12:29 +0100 (lun., 01 févr. 2010) | 3 lines
r77895 broke doctest.
................
Diffstat (limited to 'Lib/test/test_memoryio.py')
| -rw-r--r-- | Lib/test/test_memoryio.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py index 07c80436..89c8196 100644 --- a/Lib/test/test_memoryio.py +++ b/Lib/test/test_memoryio.py @@ -72,7 +72,7 @@ class MemoryTestMixin: self.assertEqual(f.seek(0), 0) self.assertEqual(f.write(t("h")), 1) self.assertEqual(f.truncate(12), 12) - self.assertEqual(f.tell(), 12) + self.assertEqual(f.tell(), 1) def test_write(self): buf = self.buftype("hello world\n") @@ -120,7 +120,8 @@ class MemoryTestMixin: self.assertEqual(memio.getvalue(), buf[:6]) self.assertEqual(memio.truncate(4), 4) self.assertEqual(memio.getvalue(), buf[:4]) - self.assertEqual(memio.tell(), 4) + self.assertEqual(memio.tell(), 6) + memio.seek(0, 2) memio.write(buf) self.assertEqual(memio.getvalue(), buf[:4] + buf) pos = memio.tell() |
