<s> from nose import tools <EOL> from trials . variations import * <EOL> class TestBernoulli : <EOL> def setup ( self ) : <EOL> self . var = BernoulliVariation ( <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> def test_update ( self ) : <EOL> self . var . update ( <NUM_LIT:100> , <NUM_LIT:20> ) <EOL> self . var . update ( <NUM_LIT:200> , <NUM_LIT:10> ) <EOL> tools . assert_true ( self . var . alpha == <NUM_LIT> ) <EOL> tools . assert_true ( self . var . beta == <NUM_LIT> ) <EOL> def test_posterior ( self ) : <EOL> self . var . update ( <NUM_LIT> , <NUM_LIT:50> ) <EOL> m = self . var . posterior . mean ( ) <EOL> self . var . posterior . var ( ) <EOL> tools . assert_true ( <NUM_LIT> < m < <NUM_LIT> ) </s>
