Remove hardcoded data dependency from acrostic test so it doesn't randomly fail if...
authorDaniil Baturin <redacted>
Thu, 10 Jul 2014 18:11:50 +0000 (01:11 +0700)
committerDaniil Baturin <redacted>
Thu, 10 Jul 2014 18:33:47 +0000 (01:33 +0700)
tests/xkcdp_tests.py

index 48d4f53da5122e7d3058fdc9aab917d9147ca9b1..3513638c729930a4790294341026eb2a7da3bf67 100644 (file)
@@ -22,11 +22,11 @@ class XkcdPasswordTests(unittest.TestCase):
         self.assertNotIn("__$$$__", self.wordlist_small)
 
     def test_acrostic(self):
-        target = ["factual", "amazing", "captain", "exactly"]
+        word = "face"
         result = xkcd_password.generate_xkcdpassword(
             self.wordlist_small,
-            acrostic="face")
-        self.assertEquals(result.split(), target)
+            acrostic=word)
+        self.assertEquals("".join(map(lambda x: x[0], result.split())), word)
 
     def test_commandlineCount(self):
         count = 5
git clone https://git.99rst.org/PROJECT