def test__add_timedelta_until__add_multiple_times(self): t = Timeframe(pd_start_date=pd_ts('2017-01-01 1:00'), pd_end_date=pd_ts('2017-01-01 2:35'), pd_timedelta=pandas.Timedelta(minutes=15)) t.add_timedelta_until(pd_ts('2017-01-01 2:31')) self.assertEqual(t.date(), pd_ts('2017-01-01 2:30'))
def test__add_timedelta_until__single(self): t = Timeframe(pd_start_date=pd_ts('2017-01-01 1:00'), pd_end_date=pd_ts('2017-01-01 2:35'), pd_interval=pandas.Timedelta(minutes=15)) t.add_timedelta_until(pd_ts('2017-01-01 1:29')) self.assertEqual(t.date(), pd_ts('2017-01-01 1:15'))