コード例 #1
0
ファイル: test_csvlib.py プロジェクト: dmonroy/pycrunch
 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)
コード例 #2
0
ファイル: importing.py プロジェクト: skriems/pycrunch
 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)
コード例 #3
0
ファイル: test_csvlib.py プロジェクト: dmonroy/pycrunch
 def test_unicode_values(self):
     # CSV rendering should handle simple unicode
     rows = [['☃']]
     csvlib.rows_as_csv_file(rows)
コード例 #4
0
ファイル: test_csvlib.py プロジェクト: aminusfu/pycrunch
	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)
コード例 #5
0
ファイル: test_csvlib.py プロジェクト: aminusfu/pycrunch
	def test_unicode_values(self):
		"CSV rendering should handle simple unicode"
		rows = [['☃']]
		csvlib.rows_as_csv_file(rows)
コード例 #6
0
ファイル: test_csvlib.py プロジェクト: Crunch-io/pycrunch
 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')
コード例 #7
0
ファイル: test_csvlib.py プロジェクト: skriems/pycrunch
 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')