Replace hardcoded data with a regex match check in the delimiter test.
authorDaniil Baturin <redacted>
Thu, 10 Jul 2014 18:29:24 +0000 (01:29 +0700)
committerDaniil Baturin <redacted>
Thu, 10 Jul 2014 18:33:55 +0000 (01:33 +0700)
tests/xkcdp_tests.py

index 3513638c729930a4790294341026eb2a7da3bf67..4a4cdce79eef1ff7ca92632f6a354513b458e5f9 100644 (file)
@@ -1,5 +1,6 @@
 import unittest
 import subprocess
+import re
 from xkcdpass import xkcd_password
 
 WORDFILE = 'xkcdpass/static/default.txt'
@@ -37,13 +38,10 @@ class XkcdPasswordTests(unittest.TestCase):
 
     def test_delim(self):
         tdelim = "_"
-        target = tdelim.join(["factual", "amazing", "captain", "exactly"])
-        # use an acrostic for simpler target check
         result = xkcd_password.generate_xkcdpassword(
             self.wordlist_small,
-            acrostic="face",
             delim=tdelim)
-        self.assertEquals(result, target)
+        self.assertIsNotNone(re.match('([a-z]+(_|$))+', result))
 
 
 if __name__ == '__main__':
git clone https://git.99rst.org/PROJECT