Back to index

enigmail  1.4.3
Public Member Functions | Public Attributes
unit-LineEndings.TestLineEndings Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def createFile
def testMac
def testUnix
def testWindows

Public Attributes

 pp
 tempnam

Detailed Description

Unit tests for the Context class

Definition at line 11 of file unit-LineEndings.py.


Member Function Documentation

def unit-LineEndings.TestLineEndings.createFile (   self,
  lineendings 
)

Definition at line 24 of file unit-LineEndings.py.

00024 
00025   def createFile(self, lineendings):
00026     f = open(self.tempnam, 'wb')
00027     for line, ending in zip(['a', '#literal b', 'c'], lineendings):
00028       f.write(line+ending)
00029     f.close()

Here is the caller graph for this function:

def unit-LineEndings.TestLineEndings.setUp (   self)

Definition at line 16 of file unit-LineEndings.py.

00016 
00017   def setUp(self):
00018     self.pp = Preprocessor()
00019     self.pp.out = StringIO()
00020     self.tempnam = os.tempnam('.')

def unit-LineEndings.TestLineEndings.tearDown (   self)

Definition at line 21 of file unit-LineEndings.py.

00021 
00022   def tearDown(self):
00023     os.remove(self.tempnam)

def unit-LineEndings.TestLineEndings.testMac (   self)

Definition at line 30 of file unit-LineEndings.py.

00030 
00031   def testMac(self):
00032     self.createFile(['\x0D']*3)
00033     self.pp.do_include(self.tempnam)
00034     self.assertEquals(self.pp.out.getvalue(), 'a\nb\nc\n')

Here is the call graph for this function:

def unit-LineEndings.TestLineEndings.testUnix (   self)

Definition at line 35 of file unit-LineEndings.py.

00035 
00036   def testUnix(self):
00037     self.createFile(['\x0A']*3)
00038     self.pp.do_include(self.tempnam)
00039     self.assertEquals(self.pp.out.getvalue(), 'a\nb\nc\n')

Here is the call graph for this function:

def unit-LineEndings.TestLineEndings.testWindows (   self)

Definition at line 40 of file unit-LineEndings.py.

00040 
00041   def testWindows(self):
00042     self.createFile(['\x0D\x0A']*3)
00043     self.pp.do_include(self.tempnam)
00044     self.assertEquals(self.pp.out.getvalue(), 'a\nb\nc\n')

Here is the call graph for this function:


Member Data Documentation

unit-LineEndings.TestLineEndings.pp

Definition at line 17 of file unit-LineEndings.py.

unit-LineEndings.TestLineEndings.tempnam

Definition at line 19 of file unit-LineEndings.py.


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