Skip to content

Commit

Permalink
bug: Iterate over normalized string
Browse files Browse the repository at this point in the history
  • Loading branch information
fubuloubu committed Mar 20, 2020
1 parent ed76b5e commit e4711b3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/core/test_mnemonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ def test_expand(lang):
m = Mnemonic(lang)
# Generates a random set of words, so will never be the same set of words
words = m.generate()
for word in words.split(" "):
for word in words.split(" "): # Space delinates in languages not excluded above
# BIP39 can support word expansion with as little as 4 characters
for size in range(4, len(word)):
assert m.expand(word[:size + 1]) == word
norm_word = normalize_string(word)
for size in range(4, len(norm_word)):
assert m.expand(norm_word[:size + 1]) == word


@pytest.mark.parametrize("lang", Mnemonic.list_languages())
Expand Down

0 comments on commit e4711b3

Please sign in to comment.