From: Daniil Baturin Date: Thu, 10 Jul 2014 18:29:24 +0000 (+0700) Subject: Replace hardcoded data with a regex match check in the delimiter test. X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=75337cf246ce849c016bafc125323dc96dbfd69f;p=redacted-XKCD-password-generator.git Replace hardcoded data with a regex match check in the delimiter test. --- diff --git a/tests/xkcdp_tests.py b/tests/xkcdp_tests.py index 3513638..4a4cdce 100644 --- a/tests/xkcdp_tests.py +++ b/tests/xkcdp_tests.py @@ -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__':