'Test convert datetime to epoch in TestDataFrameClient object.'

def test_datetime_to_epoch(self):

    timestamp = pd.Timestamp(u'2013-01-01    00:00:00.000+00:00')
    cli = DataFrameClient(u'host', 8086, u'username', u'password', u'db')
    self.assertEqual(cli._datetime_to_epoch(timestamp), 1356998400.0)
    self.assertEqual(cli._datetime_to_epoch(timestamp, time_precision=u'h'), (1356998400.0 / 3600))
    self.assertEqual(cli._datetime_to_epoch(timestamp, time_precision=u'm'), (1356998400.0 / 60))
    self.assertEqual(cli._datetime_to_epoch(timestamp, time_precision=u's'), 1356998400.0)
    self.assertEqual(cli._datetime_to_epoch(timestamp, time_precision=u'ms'), 1356998400000.0)
    self.assertEqual(cli._datetime_to_epoch(timestamp, time_precision=u'u'), 1356998400000000.0)
    self.assertEqual(cli._datetime_to_epoch(timestamp, time_precision=u'n'), 1.3569984e+18)
