Ejemplo n.º 1
0
    def test_from_csv_delimiter(self):
        raw_data = b'one\t2\r\nthree,four\t5\r\n'

        data = from_csv(raw_data, delimiter='\t')

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

        data = from_csv(raw_data, encoding='latin-1')

        self.assertEqual(data, [['øne', '2'], ['three,four', '5']])
Ejemplo n.º 3
0
    def test_from_csv(self):
        raw_data = b'one,2\r\n"three,four",5\r\n'

        data = from_csv(raw_data)

        self.assertEqual(data, [['one', '2'], ['three,four', '5']])