summaryrefslogtreecommitdiff
path: root/Lib/test/test_univnewlines.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-18 21:39:55 +0000
committerGuido van Rossum <guido@python.org>2007-08-18 21:39:55 +0000
commit1759666564d533b827ff28f1b3e9564195e2fee2 (patch)
treea75659c752fdf88c63f48d09eec936756040af37 /Lib/test/test_univnewlines.py
parent384283f1b76f50294f61810210bd995846e8d361 (diff)
downloadcpython-1759666564d533b827ff28f1b3e9564195e2fee2.tar.gz
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 7810caef8c..350bad3364 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,