From: Steven Tobin Date: Mon, 20 Nov 2023 14:56:49 +0000 (+0000) Subject: fixes failing unit test X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=8396611102b328a8f851ef72a74213b3c5794c8f;p=redacted-XKCD-password-generator.git fixes failing unit test --- diff --git a/README.rst b/README.rst index 7bd337b..0a0de75 100644 --- a/README.rst +++ b/README.rst @@ -193,6 +193,7 @@ or setting the appropriate environment variable:: Changelog ========= +- **1.19.6** Fixes randomly failing unit test - **1.19.5** Adds "as-is" option for case - **1.19.4** Makes randomised delimiters behavior consistent with fixed delimeters - **1.19.3** Restore a randomly sampled version of eff_large_de wordlist @@ -211,7 +212,6 @@ Changelog - **1.16.5** Adds title case option for `--case` - **1.16.4** Improve unit tests, fixes broken test on python 2 - **1.16.3** Correct links for German worldist, updated docs to include the list -- **1.16.2** Fix exception on UTF8 open with python 2.x License ======= diff --git a/setup.py b/setup.py index 08f7053..a8c50f5 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import sys setup( name='xkcdpass', - version='1.19.5', + version='1.19.6', author='Steven Tobin', author_email='steventtobin@gmail.com', url='https://github.com/redacted/XKCD-password-generator', diff --git a/tests/test_xkcdpass.py b/tests/test_xkcdpass.py index 5a036f1..8d7c78d 100644 --- a/tests/test_xkcdpass.py +++ b/tests/test_xkcdpass.py @@ -51,8 +51,8 @@ class XkcdPasswordTests(unittest.TestCase): def test_random_delimiter(self): wordlist = xkcd_password.generate_wordlist(WORDFILE, min_length=3, max_length=3) result = xkcd_password.generate_xkcdpassword(wordlist, numwords=3, random_delimiters=True) - - self.assertEqual(11, len(result)) + # result can be length 9, 10, or 11 depending on which random delimiters are chose + self.assertTrue(len(result) in [9, 10, 11]) def test_set_case(self): words = "this is only a GREAT Test".lower().split() diff --git a/xkcdpass/xkcd_password.py b/xkcdpass/xkcd_password.py index 5c66216..70fa112 100755 --- a/xkcdpass/xkcd_password.py +++ b/xkcdpass/xkcd_password.py @@ -14,7 +14,7 @@ import sys from io import open __LICENSE__ = """ -Copyright (c) 2011 - 2018, Steven Tobin and Contributors. +Copyright (c) 2011 - 2023, Steven Tobin and Contributors. All rights reserved. Redistribution and use in source and binary forms, with or without