23 lines
570 B
Python
23 lines
570 B
Python
|
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")
|