"Fix" tests
authorLowe Thiderman <redacted>
Tue, 27 May 2014 22:34:43 +0000 (00:34 +0200)
committerLowe Thiderman <redacted>
Tue, 27 May 2014 22:34:43 +0000 (00:34 +0200)
Due to the changes incurred by the packaging, the tests needed some changes as
well. I've fixed those, but three tests still fail. However, I ran the tests on
origin/master, and three of them were failing.
I can help with that, but it's out of scope for this PR. ;)

tests/xkcdp_tests.py

index 95fd4d01762c4ca324e1a9ef307e304fb14e40bd..f04e51d073d3f5848704c9e2b2d9e55042e9bda3 100644 (file)
@@ -1,12 +1,14 @@
 import unittest
 import subprocess
-import xkcd_password
+from xkcdpass import xkcd_password
+
+WORDFILE = 'xkcdpass/static/3esl.txt'
 
 
 class XkcdPasswordTests(unittest.TestCase):
     def setUp(self):
         self.wordlist_full = xkcd_password.generate_wordlist(
-            wordfile='3esl.txt',
+            wordfile=WORDFILE,
             min_length=5,
             max_length=8,)
         self.wordlist_small = xkcd_password.generate_wordlist(
@@ -29,7 +31,8 @@ class XkcdPasswordTests(unittest.TestCase):
     def test_commandlineCount(self):
         count = 5
         result = subprocess.check_output(
-            ["python", "xkcd_password.py", "-w", "3esl.txt", "-c", str(count)])
+            ["python", "xkcdpass/xkcd_password.py", "-w", WORDFILE,
+             "-c", str(count)])
         self.assertTrue(result.count("\n"), count)
 
     def test_delim(self):
git clone https://git.99rst.org/PROJECT