def test_takes_average_of_three_days_ago_to_compute_interval(self): until = now() values = [ burndown_entry(until - timedelta(days=9), 40), # five per day burndown_entry(until - timedelta(days=5), 10), burndown_entry(until - timedelta(days=4), 15), ] generator = BurndownTrendLineGenerator(reference_interval=timedelta(days=3)) extrapolation = generator.calculate(values, until) self.assert_length(2, extrapolation) self.assert_equals([burndown_entry(values[-1].when, 15), burndown_entry(until, 15 - 4*5)], extrapolation)
class TrendlineGeneratorTest(AgiloTestCase): def setUp(self): self.super() self.generator = BurndownTrendLineGenerator( ) #self.env), intervall=timedelta(days=3) def test_smoke(self): self.assert_not_none(self.generator) def test_generate_no_trendline_from_empty_input(self): self.assert_is_empty(self.generator.calculate([], now())) def test_generate_no_trendline_from_one_input(self): burndown_values = [burndown_entry(now(), 0)] self.assert_is_empty(self.generator.calculate(burndown_values, now())) def test_continues_straight_line_if_only_two_values_further_apart_than_the_interval_are_given( self): until = now() first = burndown_entry(until - timedelta(days=10), 10) second = burndown_entry(until - timedelta(days=5), 5) extrapolation = self.generator.calculate([first, second], until) self.assert_length(2, extrapolation) self.assert_equals( [burndown_entry(second.when, 5), burndown_entry(until, 0)], extrapolation) def test_continues_straight_line_if_two_values_are_closer_together_than_the_interval_are_given( self): until = now() first = burndown_entry(until - timedelta(minutes=10), 10) second = burndown_entry(until - timedelta(minutes=5), 5) extrapolation = self.generator.calculate([first, second], until) self.assert_length(2, extrapolation) self.assert_equals( [burndown_entry(second.when, 5), burndown_entry(until, 0)], extrapolation) def test_takes_average_of_three_days_ago_to_compute_interval(self): until = now() values = [ burndown_entry(until - timedelta(days=9), 40), # five per day burndown_entry(until - timedelta(days=5), 10), burndown_entry(until - timedelta(days=4), 15), ] generator = BurndownTrendLineGenerator(reference_interval=timedelta( days=3)) extrapolation = generator.calculate(values, until) self.assert_length(2, extrapolation) self.assert_equals([ burndown_entry(values[-1].when, 15), burndown_entry(until, 15 - 4 * 5) ], extrapolation)
def test_takes_average_of_three_days_ago_to_compute_interval(self): until = now() values = [ burndown_entry(until - timedelta(days=9), 40), # five per day burndown_entry(until - timedelta(days=5), 10), burndown_entry(until - timedelta(days=4), 15), ] generator = BurndownTrendLineGenerator(reference_interval=timedelta( days=3)) extrapolation = generator.calculate(values, until) self.assert_length(2, extrapolation) self.assert_equals([ burndown_entry(values[-1].when, 15), burndown_entry(until, 15 - 4 * 5) ], extrapolation)
class TrendlineGeneratorTest(AgiloTestCase): def setUp(self): self.super() self.generator = BurndownTrendLineGenerator() #self.env), intervall=timedelta(days=3) def test_smoke(self): self.assert_not_none(self.generator) def test_generate_no_trendline_from_empty_input(self): self.assert_is_empty(self.generator.calculate([], now())) def test_generate_no_trendline_from_one_input(self): burndown_values = [burndown_entry(now(), 0)] self.assert_is_empty(self.generator.calculate(burndown_values, now())) def test_continues_straight_line_if_only_two_values_further_apart_than_the_interval_are_given(self): until = now() first = burndown_entry(until - timedelta(days=10), 10) second = burndown_entry(until - timedelta(days=5), 5) extrapolation = self.generator.calculate([first, second], until) self.assert_length(2, extrapolation) self.assert_equals([burndown_entry(second.when, 5), burndown_entry(until, 0)], extrapolation) def test_continues_straight_line_if_two_values_are_closer_together_than_the_interval_are_given(self): until = now() first = burndown_entry(until - timedelta(minutes=10), 10) second = burndown_entry(until - timedelta(minutes=5), 5) extrapolation = self.generator.calculate([first, second], until) self.assert_length(2, extrapolation) self.assert_equals([burndown_entry(second.when, 5), burndown_entry(until, 0)], extrapolation) def test_takes_average_of_three_days_ago_to_compute_interval(self): until = now() values = [ burndown_entry(until - timedelta(days=9), 40), # five per day burndown_entry(until - timedelta(days=5), 10), burndown_entry(until - timedelta(days=4), 15), ] generator = BurndownTrendLineGenerator(reference_interval=timedelta(days=3)) extrapolation = generator.calculate(values, until) self.assert_length(2, extrapolation) self.assert_equals([burndown_entry(values[-1].when, 15), burndown_entry(until, 15 - 4*5)], extrapolation)
def setUp(self): self.super() self.generator = BurndownTrendLineGenerator() #self.env), intervall=timedelta(days=3)
def _trend_line(self, actual_data, end): return BurndownTrendLineGenerator().calculate(actual_data, end)
def setUp(self): self.super() self.generator = BurndownTrendLineGenerator( ) #self.env), intervall=timedelta(days=3)