Esempio n. 1
0
 def test_tail(self):
     """tail should return prob/2 if test is true, or 1-(prob/2) if false"""
     self.assertFloatEqual(tail(0.25, True), 0.125)
     self.assertFloatEqual(tail(0.25, False), 0.875)
     self.assertFloatEqual(tail(1, True), 0.5)
     self.assertFloatEqual(tail(1, False), 0.5)
     self.assertFloatEqual(tail(0, True), 0)
     self.assertFloatEqual(tail(0, False), 1)
Esempio n. 2
0
 def test_tail(self):
     """tail should return x/2 if test is true; 1-(x/2) otherwise"""
     self.assertFloatEqual(tail(0.25, "a" == "a"), 0.25 / 2)
     self.assertFloatEqual(tail(0.25, "a" != "a"), 1 - (0.25 / 2))