Merge pull request #144 from chkpnt/as-is-case
authorSteven Tobin <redacted>
Wed, 8 Nov 2023 17:37:29 +0000 (17:37 +0000)
committerGitHub <redacted>
Wed, 8 Nov 2023 17:37:29 +0000 (17:37 +0000)
as-is case

1  2 
tests/test_xkcdpass.py
xkcdpass/xkcd_password.py

index 0a840053d357f10d5f220463cb54c290354904a3,529455b65425aeb328a26f05ca9301eab9f6692d..5a036f145871de52012879e01f2ad505aa19fc02
@@@ -48,14 -48,8 +48,14 @@@ class XkcdPasswordTests(unittest.TestCa
              delimiter=tdelim)
          self.assertIsNotNone(re.match('([a-z]+(_|$))+', result))
  
 +    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))
 +
      def test_set_case(self):
-         words = "this is only a test".lower().split()
+         words = "this is only a GREAT Test".lower().split()
          words_before = set(words)
  
          results = {}
index 9cb7f4b215cf3bb6bb59cf6655cd8a15791344c9,43bdb67da8f1843ee2e6f1064e71fa790fb2c524..5c66216e4d4226e99ffb05f6e97a2ff44c193e8b
@@@ -368,11 -381,13 +381,12 @@@ def randomized_delimiter_join(words, de
      Join the words into a password with random delimiters between each word
      """
  
 -    final_passwd = ''
 -    for word in words:
 +    final_passwd = words[0]
 +    for word in words[1:]:
          final_passwd += choose_delimiter(delimiters) + word
 -
 -    return final_passwd + choose_delimiter(delimiters)
 +    return final_passwd
  
  def choose_delimiter(delimiters):
      """
      Choose a random delimiter from the list
git clone https://git.99rst.org/PROJECT