kumisbespassung/lotto/lotto_test.py

23 lines
570 B
Python
Raw Normal View History

2017-11-12 16:44:32 +00:00
import lotto
def test_lotto():
no_system = lotto.run_draws(100000, True)
print("100,000 draws with default settings: %fs" % no_system)
system = lotto.run_draws(100000, True, system = True)
print("100,000 draws with system randomness: %fs" % system)
assert no_system < system
single_draw = lotto.run_draws()
assert len(single_draw) == 1
assert len(single_draw[0]) == 7
stats = lotto.run_draws(100000, statistics = True)
assert type(stats) == dict
lotto.generate_plot(stats, "lotto_histogramm.png")
print("Generated histogram as lotto_histogramm.png")