From 6f999e30c76beaabf58ee2bfa4789e2d3746af67 Mon Sep 17 00:00:00 2001 From: ulif <uli@gnufix.de> Date: Mon, 27 Feb 2017 13:31:36 +0100 Subject: [PATCH] Shorten test. --- tests/test_random_sources.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test_random_sources.py b/tests/test_random_sources.py index ebf720e..542bae4 100644 --- a/tests/test_random_sources.py +++ b/tests/test_random_sources.py @@ -5,6 +5,7 @@ import sys import argparse from conftest import InputMock from io import StringIO +from itertools import product, chain from diceware import main from diceware.random_sources import ( SystemRandomSource, RealDiceRandomSource, @@ -265,10 +266,8 @@ class TestRealDiceRandomSource(object): src.dice_sides = 4 dist = [0, 0, 0] fake_input( - ["1", "1", "1", "2", "1", "3", "1", "4", - "2", "1", "2", "2", "2", "3", "2", "4", - "3", "1", "3", "2", "3", "3", "3", "4", - "4", "1", "4", "2", "4", "3", "4", "4"]) + list(chain.from_iterable( + product(["1", "2", "3", "4"], repeat=2)))) for x in range(16): picked = src.choice([1, 2, 3]) dist[picked - 1] += 1 -- GitLab