From: Daniil Baturin Date: Thu, 10 Jul 2014 18:11:50 +0000 (+0700) Subject: Remove hardcoded data dependency from acrostic test so it doesn't randomly fail if... X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=77c1a9d24b7ef3689dfbcf38ede52018f07ce4ec;p=redacted-XKCD-password-generator.git Remove hardcoded data dependency from acrostic test so it doesn't randomly fail if data file is modified. --- diff --git a/tests/xkcdp_tests.py b/tests/xkcdp_tests.py index 48d4f53..3513638 100644 --- a/tests/xkcdp_tests.py +++ b/tests/xkcdp_tests.py @@ -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