[Python-checkins] python/nondist/sandbox/csv/test test_csv.py,1.36,1.37

montanaro@users.sourceforge.net montanaro@users.sourceforge.net
Tue, 18 Mar 2003 15:07:04 -0800


Update of /cvsroot/python/python/nondist/sandbox/csv/test
In directory sc8-pr-cvs1:/tmp/cvs-serv15057

Modified Files:
	test_csv.py 
Log Message:
add test using a space character as the delimiter (based upon problems
Andrew Dalke had)


Index: test_csv.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/csv/test/test_csv.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** test_csv.py	18 Mar 2003 21:47:57 -0000	1.36
--- test_csv.py	18 Mar 2003 23:07:00 -0000	1.37
***************
*** 194,197 ****
--- 194,208 ----
          self.assertRaises(csv.Error, myexceltsv)
  
+     def test_space_dialect(self):
+         class space(csv.excel):
+             delimiter = " "
+             quoting = csv.QUOTE_NONE
+             escapechar = "\\"
+ 
+         s = StringIO("abc def\nc1ccccc1 benzene\n")
+         rdr = csv.reader(s, dialect=space())
+         self.assertEqual(rdr.next(), ["abc", "def"])
+         self.assertEqual(rdr.next(), ["c1ccccc1", "benzene"])
+ 
      def test_dialect_apply(self):
          class testA(csv.excel):