Skip to content
Snippets Groups Projects
Commit 9d5cbccd authored by ulif's avatar ulif
Browse files

Also accept upper case in wordlist names.

There is no need for us to enforce lowercase wordlist names. It
could even confuse people.
parent 13fdc047
No related branches found
No related tags found
No related merge requests found
......@@ -152,7 +152,7 @@ def get_wordlist_path(name):
if not RE_WORDLIST_NAME.match(name):
raise ValueError("Not a valid wordlist name: %s" % name)
basename = 'wordlist_%s.txt' % name
return os.path.join(WORDLISTS_DIR, basename.lower())
return os.path.join(WORDLISTS_DIR, basename)
def insert_special_char(word, specials=SPECIAL_CHARS, rnd=None):
......
......@@ -110,12 +110,6 @@ class TestDicewareModule(object):
assert exc_info.value.args[0].startswith(
'Not a valid wordlist name')
def test_get_wordlist_path_loweres_country_code(self):
# upper case country codes are lowered
assert os.path.basename(get_wordlist_path('de')) == 'wordlist_de.txt'
assert os.path.basename(get_wordlist_path('De')) == 'wordlist_de.txt'
assert os.path.basename(get_wordlist_path('DE')) == 'wordlist_de.txt'
def test_insert_special_char(self):
# we can insert special chars in words.
fake_rnd = FakeRandom()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment