Ejemplo n.º 1
0
    def test_to_csv_delimiter(self):
        test_data = [['one', 2], ['three,four', 5]]

        raw_data = to_csv(test_data, delimiter='\t')

        self.assertEqual(raw_data, b'one\t2\r\nthree,four\t5\r\n')
Ejemplo n.º 2
0
    def test_to_csv_encoding(self):
        test_data = [['øne', 2], ['three,four', 5]]

        raw_data = to_csv(test_data, encoding='latin-1')

        self.assertEqual(raw_data, b'\xf8ne,2\r\n"three,four",5\r\n')
Ejemplo n.º 3
0
    def test_to_csv(self):
        test_data = [['one', 2], ['three,four', 5]]

        raw_data = to_csv(test_data)

        self.assertEqual(raw_data, b'one,2\r\n"three,four",5\r\n')