From 9d5cbccdd1ba87a62419feed9cd2f3216c39471c Mon Sep 17 00:00:00 2001 From: ulif <uli@gnufix.de> Date: Thu, 2 Jul 2015 18:00:06 +0200 Subject: [PATCH] Also accept upper case in wordlist names. There is no need for us to enforce lowercase wordlist names. It could even confuse people. --- diceware/__init__.py | 2 +- tests/test_diceware.py | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/diceware/__init__.py b/diceware/__init__.py index 8ad1610..18ae20b 100644 --- a/diceware/__init__.py +++ b/diceware/__init__.py @@ -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): diff --git a/tests/test_diceware.py b/tests/test_diceware.py index bd2a353..af7e7d6 100644 --- a/tests/test_diceware.py +++ b/tests/test_diceware.py @@ -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() -- GitLab