fixes failing unit test
authorSteven Tobin <redacted>
Mon, 20 Nov 2023 14:56:49 +0000 (14:56 +0000)
committerSteven Tobin <redacted>
Mon, 20 Nov 2023 14:56:49 +0000 (14:56 +0000)
README.rst
setup.py
tests/test_xkcdpass.py
xkcdpass/xkcd_password.py

index 7bd337b3fb0b66ae782c8aab8b92584b995378e9..0a0de756f0cf9d1714c00ee3dd62a4add1e42217 100644 (file)
@@ -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
 =======
index 08f705358a374c76a5584919902227542fb30dc0..a8c50f538305ddbc82179432b9c768955446919f 100644 (file)
--- 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',
index 5a036f145871de52012879e01f2ad505aa19fc02..8d7c78d98b1d47068c29e3cdf567a489b8312a0f 100644 (file)
@@ -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()
index 5c66216e4d4226e99ffb05f6e97a2ff44c193e8b..70fa11230868dc0641a2999907f90d75b9457901 100755 (executable)
@@ -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
git clone https://git.99rst.org/PROJECT