Exemplo n.º 1
0
 def testWithinSmallPercentOfTop(self):
   self.risks = {1: 0.05, 2: 0.0499, 3: 0.0498}
   self.assertEqual(risk_report.GetCLRiskReport(42), {
       'Bad CL risk for 1 = 5.0%': 'http://crrev.com/c/1',
       'Bad CL risk for 2 = 5.0%': 'http://crrev.com/c/2',
       'Bad CL risk for 3 = 5.0%': 'http://crrev.com/c/3'
   })
Exemplo n.º 2
0
 def testMultipleAboveAndSomeBelow(self):
   # Anything below the 10% threshold won't be displayed so long as there are
   # other CLs whose risk is above the threshold.
   self.risks = {1: 0.5, 2: 0.4999, 3: 0.4998, 4: 0.01}
   self.assertEqual(risk_report.GetCLRiskReport(42), {
       'Bad CL risk for 1 = 50.0%': 'http://crrev.com/c/1',
       'Bad CL risk for 2 = 50.0%': 'http://crrev.com/c/2',
       'Bad CL risk for 3 = 50.0%': 'http://crrev.com/c/3'
   })
Exemplo n.º 3
0
 def testSingle(self):
   self.risks = {1: 0.0}
   self.assertEqual(risk_report.GetCLRiskReport(42), {
       'Bad CL risk for 1 = 0.0%': 'http://crrev.com/c/1'
   })
Exemplo n.º 4
0
 def testMultipleBelow(self):
   self.risks = {1: 0.05, 2: 0.03, 3: 0.01}
   self.assertEqual(risk_report.GetCLRiskReport(42), {
       'Bad CL risk for 1 = 5.0%': 'http://crrev.com/c/1'
   })
Exemplo n.º 5
0
 def testMissing(self):
   self.risks = {}
   self.assertEqual(risk_report.GetCLRiskReport(42), {})