64 cnvt = pgstore._copyfrom_buffer_convert_datetime |
64 cnvt = pgstore._copyfrom_buffer_convert_datetime |
65 self.assertEqual('0666-06-13 06:06:06.000000', cnvt(DT.datetime(666, 6, 13, 6, 6, 6))) |
65 self.assertEqual('0666-06-13 06:06:06.000000', cnvt(DT.datetime(666, 6, 13, 6, 6, 6))) |
66 |
66 |
67 # test buffer |
67 # test buffer |
68 def test_create_copyfrom_buffer_tuple(self): |
68 def test_create_copyfrom_buffer_tuple(self): |
69 l = long if PY2 else int |
69 l = long if PY2 else int # noqa: E741 |
70 data = ((42, l(42), 42.42, u'éléphant', DT.date(666, 1, 13), DT.time(6, 6, 6), |
70 data = ((42, l(42), 42.42, u'éléphant', DT.date(666, 1, 13), DT.time(6, 6, 6), |
71 DT.datetime(666, 6, 13, 6, 6, 6)), |
71 DT.datetime(666, 6, 13, 6, 6, 6)), |
72 (6, l(6), 6.6, u'babar', DT.date(2014, 1, 14), DT.time(4, 2, 1), |
72 (6, l(6), 6.6, u'babar', DT.date(2014, 1, 14), DT.time(4, 2, 1), |
73 DT.datetime(2014, 1, 1, 0, 0, 0))) |
73 DT.datetime(2014, 1, 1, 0, 0, 0))) |
74 results = pgstore._create_copyfrom_buffer(data) |
74 results = pgstore._create_copyfrom_buffer(data) |