summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_univnewlines.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-18 21:39:55 (GMT)
committerGuido van Rossum <guido@python.org>2007-08-18 21:39:55 (GMT)
commit8358db22faa3d8fa9ac0ef2f2c1ff1770a843996 (patch)
treed3be700f72499f59816b5472ff3a03ae0150ac46 /Lib/test/test_univnewlines.py
parentb99f762f10edb2646a634c2290ecb064bd52e5c7 (diff)
downloadcpython-8358db22faa3d8fa9ac0ef2f2c1ff1770a843996.zip
cpython-8358db22faa3d8fa9ac0ef2f2c1ff1770a843996.tar.gz
cpython-8358db22faa3d8fa9ac0ef2f2c1ff1770a843996.tar.bz2
New I/O code from Tony Lownds implement newline feature correctly,
and implements .newlines attribute in a 2.x-compatible fashion.
Diffstat (limited to 'Lib/test/test_univnewlines.py')
-rw-r--r--Lib/test/test_univnewlines.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/Lib/test/test_univnewlines.py b/Lib/test/test_univnewlines.py
index 7810cae..350bad3 100644
--- a/Lib/test/test_univnewlines.py
+++ b/Lib/test/test_univnewlines.py
@@ -12,9 +12,8 @@ FATX = 'x' * (2**14)
DATA_TEMPLATE = [
"line1=1",
- "line2='this is a very long line designed to go past the magic " +
- "hundred character limit that is inside fileobject.c and which " +
- "is meant to speed up the common case, but we also want to test " +
+ "line2='this is a very long line designed to go past any default " +
+ "buffer limits that exist in io.py but we also want to test " +
"the uncommon case, naturally.'",
"def line3():pass",
"line4 = '%s'" % FATX,
@@ -32,7 +31,7 @@ DATA_SPLIT = [x + "\n" for x in DATA_TEMPLATE]
class TestGenericUnivNewlines(unittest.TestCase):
# use a class variable DATA to define the data to write to the file
# and a class variable NEWLINE to set the expected newlines value
- READMODE = 'U'
+ READMODE = 'r'
WRITEMODE = 'wb'
def setUp(self):
@@ -79,12 +78,6 @@ class TestGenericUnivNewlines(unittest.TestCase):
self.assertEqual(data, DATA_SPLIT[1:])
-class TestNativeNewlines(TestGenericUnivNewlines):
- NEWLINE = None
- DATA = DATA_LF
- READMODE = 'r'
- WRITEMODE = 'w'
-
class TestCRNewlines(TestGenericUnivNewlines):
NEWLINE = '\r'
DATA = DATA_CR
@@ -104,7 +97,6 @@ class TestMixedNewlines(TestGenericUnivNewlines):
def test_main():
test_support.run_unittest(
- TestNativeNewlines,
TestCRNewlines,
TestLFNewlines,
TestCRLFNewlines,