Back to index

python3.2  3.2.2
Public Member Functions
test.test_csv.TestDialectValidity Class Reference

List of all members.

Public Member Functions

def test_quoting
def test_delimiter
def test_lineterminator

Detailed Description

Definition at line 708 of file test_csv.py.


Member Function Documentation

Definition at line 733 of file test_csv.py.

00733 
00734     def test_delimiter(self):
00735         class mydialect(csv.Dialect):
00736             delimiter = ";"
00737             escapechar = '\\'
00738             doublequote = False
00739             skipinitialspace = True
00740             lineterminator = '\r\n'
00741             quoting = csv.QUOTE_NONE
00742         d = mydialect()
00743 
00744         mydialect.delimiter = ":::"
00745         self.assertRaises(csv.Error, mydialect)
00746 
00747         mydialect.delimiter = 4
00748         self.assertRaises(csv.Error, mydialect)

Here is the call graph for this function:

Definition at line 749 of file test_csv.py.

00749 
00750     def test_lineterminator(self):
00751         class mydialect(csv.Dialect):
00752             delimiter = ";"
00753             escapechar = '\\'
00754             doublequote = False
00755             skipinitialspace = True
00756             lineterminator = '\r\n'
00757             quoting = csv.QUOTE_NONE
00758         d = mydialect()
00759 
00760         mydialect.lineterminator = ":::"
00761         d = mydialect()
00762 
00763         mydialect.lineterminator = 4
00764         self.assertRaises(csv.Error, mydialect)
00765 

Here is the call graph for this function:

Definition at line 709 of file test_csv.py.

00709 
00710     def test_quoting(self):
00711         class mydialect(csv.Dialect):
00712             delimiter = ";"
00713             escapechar = '\\'
00714             doublequote = False
00715             skipinitialspace = True
00716             lineterminator = '\r\n'
00717             quoting = csv.QUOTE_NONE
00718         d = mydialect()
00719 
00720         mydialect.quoting = None
00721         self.assertRaises(csv.Error, mydialect)
00722 
00723         mydialect.doublequote = True
00724         mydialect.quoting = csv.QUOTE_ALL
00725         mydialect.quotechar = '"'
00726         d = mydialect()
00727 
00728         mydialect.quotechar = "''"
00729         self.assertRaises(csv.Error, mydialect)
00730 
00731         mydialect.quotechar = 4
00732         self.assertRaises(csv.Error, mydialect)

Here is the call graph for this function:


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