From: Steven Tobin Date: Sun, 8 Apr 2018 16:45:14 +0000 (+0100) Subject: Merge pull request #96 from szaydel/szaydel/add-capitalize X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=5181e8016303b13646782923dcc5b3ece677648b;p=redacted-XKCD-password-generator.git Merge pull request #96 from szaydel/szaydel/add-capitalize Want to have option to capitalize first letter of each word. --- 5181e8016303b13646782923dcc5b3ece677648b diff --cc tests/test_xkcdpass.py index 2993796,6350df2..516b028 --- a/tests/test_xkcdpass.py +++ b/tests/test_xkcdpass.py @@@ -66,11 -85,10 +67,12 @@@ class XkcdPasswordTests(unittest.TestCa # Test that the words have been uppered or lowered respectively. self.assertTrue(all(word.islower() for word in results["lower"])) self.assertTrue(all(word.isupper() for word in results["upper"])) + self.assertTrue(all(word.istitle() for word in results["first"])) # Test that the words have been correctly uppered randomly. - expected_random_result_1 = ['THIS', 'IS', 'ONLY', 'a', 'test'] - expected_random_result_2 = ['THIS', 'IS', 'a', 'test', 'ALSO'] + expected_random_result_1_py3 = ['THIS', 'IS', 'ONLY', 'a', 'test'] + expected_random_result_2_py3 = ['THIS', 'IS', 'a', 'test', 'ALSO'] + expected_random_result_1_py2 = ['this', 'is', 'only', 'a', 'TEST'] + expected_random_result_2_py2 = ['this', 'is', 'a', 'TEST', 'also'] words_extra = "this is a test also".lower().split() observed_random_result_1 = results["random"]