'Test timing intervals of sensors.'

def test_intervals(self):

    device = time_date.TimeDateSensor(self.hass, 'time')
    now = dt_util.utc_from_timestamp(45)
    next_time = device.get_next_interval(now)
    assert (next_time == dt_util.utc_from_timestamp(60))
    device = time_date.TimeDateSensor(self.hass, 'date')
    now = dt_util.utc_from_timestamp(12345)
    next_time = device.get_next_interval(now)
    assert (next_time == dt_util.utc_from_timestamp(86400))
    device = time_date.TimeDateSensor(self.hass, 'beat')
    now = dt_util.utc_from_timestamp(29)
    next_time = device.get_next_interval(now)
    assert (next_time == dt_util.utc_from_timestamp(86.4))
    device = time_date.TimeDateSensor(self.hass, 'date_time')
    now = dt_util.utc_from_timestamp(1495068899)
    next_time = device.get_next_interval(now)
    assert (next_time == dt_util.utc_from_timestamp(1495068900))
    now = dt_util.utcnow()
    device = time_date.TimeDateSensor(self.hass, 'time_date')
    next_time = device.get_next_interval()
    assert (next_time > now)
