Esempio n. 1
0
 def test_near_target_worse_than_target(self):
     """Test that the measurement is red when the near target is worse than the target."""
     metric = dict(type="metric_type",
                   target="20",
                   near_target="15",
                   debt_target=None,
                   accept_debt=False)
     self.assertEqual(
         "target_met",
         determine_measurement_status(self.database, metric, "17"))
Esempio n. 2
0
 def test_green_with_debt(self):
     """Test a measurement with debt, better than the target."""
     metric = dict(type="metric_type",
                   target="20",
                   near_target="25",
                   debt_target="30",
                   accept_debt=True)
     self.assertEqual(
         "target_met",
         determine_measurement_status(self.database, metric, "15"))
Esempio n. 3
0
 def test_debt_not_met(self):
     """Test a measurement worse than the accepted debt."""
     metric = dict(type="metric_type",
                   target="20",
                   near_target="25",
                   debt_target="30",
                   accept_debt=True)
     self.assertEqual(
         "target_not_met",
         determine_measurement_status(self.database, metric, "35"))
Esempio n. 4
0
 def test_red(self):
     """Test a red measurement."""
     metric = dict(type="metric_type",
                   target="20",
                   near_target="25",
                   debt_target=None,
                   accept_debt=False)
     self.assertEqual(
         "target_not_met",
         determine_measurement_status(self.database, metric, "30"))
Esempio n. 5
0
 def test_debt_past_end_date(self):
     """Test a measurement with experide debt."""
     metric = dict(type="metric_type",
                   target="20",
                   near_target="25",
                   debt_target="30",
                   accept_debt=True,
                   debt_end_date="2019-06-10")
     self.assertEqual(
         "target_not_met",
         determine_measurement_status(self.database, metric, "29"))