Example #1
0
 def test_result_is_binary(self):
     # Result should be a stream with a binary type
     res = csvlib.rows_as_csv_file([['foo']])
     assert isinstance(next(res), six.binary_type)
Example #2
0
 def append_rows(self, ds, rows):
     """Append the given rows of Python values. Return the new Batch."""
     f = csvlib.rows_as_csv_file(rows)
     return self.append_csv_string(ds, f)
Example #3
0
 def test_unicode_values(self):
     # CSV rendering should handle simple unicode
     rows = [['☃']]
     csvlib.rows_as_csv_file(rows)
Example #4
0
	def test_result_is_binary(self):
		"Result should be a stream with a binary type"
		res = csvlib.rows_as_csv_file([['foo']])
		assert isinstance(next(res), six.binary_type)
Example #5
0
	def test_unicode_values(self):
		"CSV rendering should handle simple unicode"
		rows = [['☃']]
		csvlib.rows_as_csv_file(rows)
Example #6
0
 def test_rows_as_csv_file(self):
     # None should be emitted as an empty cell (unquoted)
     rows = [[0, 1, None, "bananas"]]
     fp = csvlib.rows_as_csv_file(rows)
     self.assertEqual(fp.read(), b'0,1,,"bananas"\n')
Example #7
0
 def test_rows_as_csv_file(self):
     # None should be emitted as an empty cell (unquoted)
     rows = [[0, 1, None, "bananas"]]
     fp = csvlib.rows_as_csv_file(rows)
     self.assertEqual(fp.read(), b'0,1,,"bananas"\n')