#5975: add unix_dialect to csv module.

This commit is contained in:
Georg Brandl 2010-10-27 07:27:06 +00:00
parent 347fe5ce3c
commit 7424dd359c
4 changed files with 32 additions and 2 deletions

View file

@ -515,6 +515,15 @@ class TestEscapedExcel(TestCsvBase):
def test_read_escape_fieldsep(self):
self.readerAssertEqual('abc\\,def\r\n', [['abc,def']])
class TestDialectUnix(TestCsvBase):
dialect = 'unix'
def test_simple_writer(self):
self.writerAssertEqual([[1, 'abc def', 'abc']], '"1","abc def","abc"\n')
def test_simple_reader(self):
self.readerAssertEqual('"1","abc def","abc"\n', [['1', 'abc def', 'abc']])
class QuotedEscapedExcel(csv.excel):
quoting = csv.QUOTE_NONNUMERIC
escapechar = '\\'