Exemplo 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)
Exemplo n.º 2
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)
Exemplo n.º 3
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))
Exemplo n.º 4
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))