Beispiel #1
0
def strategy_test():
    print "Commencing strategy function test..."
    tests = [((6, 6, 4, 3, 2), 6, (mp4.expected_value((6, 6), 6, 3), (6, 6))),
    ]
    
    strategy_ts = pst.TestSuite()
    
    for test in tests:
        computed = mp4.strategy(test[0], test[1])
        expected = test[2]
        strategy_ts.run_test(computed, expected)
        
    strategy_ts.report_results()
    print   
Beispiel #2
0
def expected_value_test():
    print "Commencing expected_value function test..."
    tests = [((6,), 6, 1, 7.0),
             ((1,), 6, 1, 22./6),
             ((6, 6), 6, 1, 13.0),
    ]
    
    exp_value_ts = pst.TestSuite()
    
    for test in tests:
        computed = mp4.expected_value(test[0], test[1], test[2])
        expected = test[3]
        exp_value_ts.run_test(computed, expected)
        
    exp_value_ts.report_results()
    print