示例#1
0
 def test_mean_and_stddev(self):
     values = [10, 5, 15]
     mean_val, stddev_val = perfcompare.MeanAndStddev(values)
     self.assertEquals(mean_val, 10.0)
     self.assertEquals(perfcompare.Mean(values), 10.0)
     self.assertEquals(stddev_val, 5.0)
     # Check error cases.
     self.assertRaises(lambda: perfcompare.Mean([]))
     self.assertRaises(lambda: perfcompare.MeanAndStddev([]))
     self.assertRaises(lambda: perfcompare.MeanAndStddev([100]))
示例#2
0
 def test_mean_and_stddev(self):
     values = [10, 5, 15]
     mean_val, stddev_val = perfcompare.MeanAndStddev(values)
     self.assertEquals(mean_val, 10.0)
     self.assertEquals(perfcompare.Mean(values), 10.0)
     self.assertEquals(stddev_val, 5.0)
     # Single-value sample.
     self.assertEquals(perfcompare.MeanAndStddev([123]), (123.0, None))
     # Check error cases.
     self.assertRaises(AssertionError, lambda: perfcompare.Mean([]))
     self.assertRaises(AssertionError,
                       lambda: perfcompare.MeanAndStddev([]))