diff --git a/diceware/random_sources.py b/diceware/random_sources.py index 2e3c8fd52d165f484867bd5b1603bd9f5e0336a4..e1e263dc0b3c79232e9aa932c7c5e3dc99ca7f4d 100644 --- a/diceware/random_sources.py +++ b/diceware/random_sources.py @@ -137,7 +137,11 @@ class RealDiceRandomSource(object): raise ValueError( "Must provide at least %s items" % self.dice_sides) if (self.dice_sides ** num_rolls) < len(sequence): - print("Warning: entropy is reduced!") + print( + "Warning: entropy is reduced! Using only first %s of %s " + "words/items of your wordlist." % ( + self.dice_sides ** num_rolls, len(sequence)) + ) print( "Please roll %s dice (or a single dice %s times)." % ( num_rolls, num_rolls)) diff --git a/tests/test_random_sources.py b/tests/test_random_sources.py index 7895daeb1278a0aebb5b7babbf1a823b0104c14f..2c828a941b61f41618a11ea8f0523f3e18a7dab9 100644 --- a/tests/test_random_sources.py +++ b/tests/test_random_sources.py @@ -196,6 +196,7 @@ class TestRealDiceRandomSource(object): assert picked == 1 out, err = capsys.readouterr() assert "entropy is reduced" in out + assert "Using only first 6 of 7 words" in out assert err == "" def test_no_hint_if_entropy_is_not_decreased(self, monkeypatch, capsys):