summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_univnewlines.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-04-16 01:38:40 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-04-16 01:38:40 (GMT)
commit863ac44b74cd66f7d289748816d65c65808c149b (patch)
tree8536f8a72110b9996cb9e6746b6bb4cf3cb73733 /Lib/test/test_univnewlines.py
parentc86c1b88f96ec48e5502b9b8ba5cc833f57ce476 (diff)
downloadcpython-863ac44b74cd66f7d289748816d65c65808c149b.zip
cpython-863ac44b74cd66f7d289748816d65c65808c149b.tar.gz
cpython-863ac44b74cd66f7d289748816d65c65808c149b.tar.bz2
Whitespace normalization.
Diffstat (limited to 'Lib/test/test_univnewlines.py')
-rw-r--r--Lib/test/test_univnewlines.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/Lib/test/test_univnewlines.py b/Lib/test/test_univnewlines.py
index e77797a..8d6a874 100644
--- a/Lib/test/test_univnewlines.py
+++ b/Lib/test/test_univnewlines.py
@@ -5,11 +5,11 @@ import os
import sys
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 " +
- "the uncommon case, naturally.'",
+ "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 " +
+ "the uncommon case, naturally.'",
"def line3():pass"
]
DATA_LF = "\n".join(DATA_TEMPLATE) + "\n"
@@ -40,13 +40,13 @@ class TestGenericUnivNewlines(unittest.TestCase):
os.unlink(test_support.TESTFN)
except:
pass
-
+
def test_read(self):
fp = open(test_support.TESTFN, self.READMODE)
data = fp.read()
self.assertEqual(data, DATA_LF)
self.assertEqual(`fp.newlines`, `self.NEWLINE`)
-
+
def test_readlines(self):
fp = open(test_support.TESTFN, self.READMODE)
data = fp.readlines()
@@ -62,7 +62,7 @@ class TestGenericUnivNewlines(unittest.TestCase):
d = fp.readline()
self.assertEqual(data, DATA_SPLIT)
self.assertEqual(`fp.newlines`, `self.NEWLINE`)
-
+
def test_seek(self):
fp = open(test_support.TESTFN, self.READMODE)
fp.readline()
@@ -72,36 +72,36 @@ class TestGenericUnivNewlines(unittest.TestCase):
fp.seek(pos)
data = fp.readlines()
self.assertEqual(data, DATA_SPLIT[1:])
-
+
def test_execfile(self):
dict = {}
execfile(test_support.TESTFN, dict)
func = dict['line3']
self.assertEqual(func.func_code.co_firstlineno, 3)
-
+
class TestNativeNewlines(TestGenericUnivNewlines):
NEWLINE=None
DATA=DATA_LF
READMODE='r'
WRITEMODE='w'
-
+
class TestCRNewlines(TestGenericUnivNewlines):
NEWLINE='\r'
DATA=DATA_CR
-
+
class TestLFNewlines(TestGenericUnivNewlines):
NEWLINE='\n'
DATA=DATA_LF
-
+
class TestCRLFNewlines(TestGenericUnivNewlines):
NEWLINE='\r\n'
DATA=DATA_CRLF
-
+
class TestMixedNewlines(TestGenericUnivNewlines):
NEWLINE=('\r', '\n')
DATA=DATA_MIXED
-
+
def test_main():
test_support.run_unittest(TestNativeNewlines)