def test_ga(self):
        """Test add_timeseries on time series with different start and end
        dates.

        """
        today = datetime(2010, 12, 5)
        tomorrow = datetime(2010, 12, 6)
        timeserie_a = TimeseriesStub((today, 10))
        timeserie_b = TimeseriesStub((tomorrow, 40))
        expected_events = [(today, 10), (tomorrow, 40)]
        events = list(add_timeseries(timeserie_a, timeserie_b).events())
        self.assertEqual(expected_events, events)
Beispiel #2
0
    def test_ga(self):
        """Test add_timeseries on time series with different start and end
        dates.

        """
        today = datetime(2010, 12, 5)
        tomorrow = datetime(2010, 12, 6)
        timeserie_a = TimeseriesStub((today, 10))
        timeserie_b = TimeseriesStub((tomorrow, 40))
        expected_events = [(today, 10), (tomorrow, 40)]
        events = list(add_timeseries(timeserie_a, timeserie_b).events())
        self.assertEqual(expected_events, events)
 def test_g(self):
     """Test add_timeseries on time series with same start and end date."""
     today = datetime(2010, 12, 5)
     tomorrow = datetime(2010, 12, 6)
     timeserie_a = TimeseriesStub()
     timeserie_a.add_value(today, 10)
     timeserie_a.add_value(tomorrow, 20)
     timeserie_b = TimeseriesStub()
     timeserie_b.add_value(today, 30)
     timeserie_b.add_value(tomorrow, 40)
     expected_timeserie = [(today, 40), (tomorrow, 60)]
     summed_timeseries = \
          list(add_timeseries(timeserie_a, timeserie_b).events())
     self.assertEqual(expected_timeserie, summed_timeseries)
Beispiel #4
0
 def test_g(self):
     """Test add_timeseries on time series with same start and end date."""
     today = datetime(2010, 12, 5)
     tomorrow = datetime(2010, 12, 6)
     timeserie_a = TimeseriesStub()
     timeserie_a.add_value(today, 10)
     timeserie_a.add_value(tomorrow, 20)
     timeserie_b = TimeseriesStub()
     timeserie_b.add_value(today, 30)
     timeserie_b.add_value(tomorrow, 40)
     expected_timeserie = [(today, 40), (tomorrow, 60)]
     summed_timeseries = \
          list(add_timeseries(timeserie_a, timeserie_b).events())
     self.assertEqual(expected_timeserie, summed_timeseries)