def test_fa(self): """Test the aggregation of a single daily events to a monthly event.""" timeserie = TimeseriesStub() timeserie.add_value(datetime(2010, 12, 8), 20) monthly_events = [event for event in timeserie.monthly_events()] expected_monthly_events = [(datetime(2010, 12, 1), 20)] self.assertEqual(expected_monthly_events, monthly_events)
def test_fb(self): """Test aggregation of a multiple daily events to a monthly event.""" timeserie = TimeseriesStub() timeserie.add_value(datetime(2010, 12, 8), 20) timeserie.add_value(datetime(2010, 12, 9), 30) timeserie.add_value(datetime(2010, 12, 10), 40) monthly_events = [event for event in timeserie.monthly_events()] expected_monthly_events = [(datetime(2010, 12, 1), 90)] self.assertEqual(expected_monthly_events, monthly_events)