Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes
test.test_univnewlines.TestCRLFNewlines Class Reference
Inheritance diagram for test.test_univnewlines.TestCRLFNewlines:
Inheritance graph
[legend]
Collaboration diagram for test.test_univnewlines.TestCRLFNewlines:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_tell
def setUp
def tearDown
def test_read
def test_readlines
def test_readline
def test_seek

Static Public Attributes

string NEWLINE = '\r\n'
 DATA = DATA_CRLF
string READMODE = 'r'
string WRITEMODE = 'wb'

Detailed Description

Definition at line 93 of file test_univnewlines.py.


Member Function Documentation

Definition at line 39 of file test_univnewlines.py.

00039 
00040     def setUp(self):
00041         data = self.DATA
00042         if "b" in self.WRITEMODE:
00043             data = data.encode("ascii")
00044         with self.open(support.TESTFN, self.WRITEMODE) as fp:
00045             fp.write(data)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 46 of file test_univnewlines.py.

00046 
00047     def tearDown(self):
00048         try:
00049             os.unlink(support.TESTFN)
00050         except:
00051             pass

Here is the caller graph for this function:

Definition at line 52 of file test_univnewlines.py.

00052 
00053     def test_read(self):
00054         with self.open(support.TESTFN, self.READMODE) as fp:
00055             data = fp.read()
00056         self.assertEqual(data, DATA_LF)
00057         self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))

Here is the call graph for this function:

Definition at line 64 of file test_univnewlines.py.

00064 
00065     def test_readline(self):
00066         with self.open(support.TESTFN, self.READMODE) as fp:
00067             data = []
00068             d = fp.readline()
00069             while d:
00070                 data.append(d)
00071                 d = fp.readline()
00072         self.assertEqual(data, DATA_SPLIT)
00073         self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))

Here is the call graph for this function:

Definition at line 58 of file test_univnewlines.py.

00058 
00059     def test_readlines(self):
00060         with self.open(support.TESTFN, self.READMODE) as fp:
00061             data = fp.readlines()
00062         self.assertEqual(data, DATA_SPLIT)
00063         self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))

Here is the call graph for this function:

Definition at line 74 of file test_univnewlines.py.

00074 
00075     def test_seek(self):
00076         with self.open(support.TESTFN, self.READMODE) as fp:
00077             fp.readline()
00078             pos = fp.tell()
00079             data = fp.readlines()
00080             self.assertEqual(data, DATA_SPLIT[1:])
00081             fp.seek(pos)
00082             data = fp.readlines()
00083         self.assertEqual(data, DATA_SPLIT[1:])
00084 

Here is the call graph for this function:

Definition at line 97 of file test_univnewlines.py.

00097 
00098     def test_tell(self):
00099         with self.open(support.TESTFN, self.READMODE) as fp:
00100             self.assertEqual(repr(fp.newlines), repr(None))
00101             data = fp.readline()
00102             pos = fp.tell()
00103         self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))

Here is the call graph for this function:


Member Data Documentation

Definition at line 95 of file test_univnewlines.py.

Definition at line 94 of file test_univnewlines.py.

Definition at line 36 of file test_univnewlines.py.

Definition at line 37 of file test_univnewlines.py.


The documentation for this class was generated from the following file: