'Test as_timestamp method.'

def test_as_timestamp(self):

    ts = 1462401234
    utc_dt = dt_util.utc_from_timestamp(ts)
    self.assertEqual(ts, dt_util.as_timestamp(utc_dt))
    utc_iso = utc_dt.isoformat()
    self.assertEqual(ts, dt_util.as_timestamp(utc_iso))
    delta = dt_util.as_timestamp('2016-01-01    12:12:12')
    delta -= dt_util.as_timestamp('2016-01-01    12:12:11')
    self.assertEqual(1, delta)
