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

Move helpers to top.

parent 9fe01779
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,17 @@ from diceware.diceware import (
)
class FakeRandom(object):
# a very, very bad random generator.
# Very handy for tests, though :-)
nums_to_draw = [0] * 100
def choice(self, elems):
num, self.nums_to_draw = self.nums_to_draw[0], self.nums_to_draw[1:]
return elems[num]
@pytest.fixture(scope="function")
def argv_handler(request):
"""This fixture restores sys.argv after tests.
......@@ -41,18 +52,6 @@ class Test_GetWordList(object):
assert ['a'] == get_wordlist(in_file.strpath)
class FakeRandom(object):
# a very, very bad random generator.
# Very handy for tests, though :-)
nums_to_draw = [0] * 100
def choice(self, elems):
num, self.nums_to_draw = self.nums_to_draw[0], self.nums_to_draw[1:]
result = elems[num]
return elems[num]
class TestDicewareModule(object):
def test_re_lang_code(self):
......
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