Example #1
0
 def test_password_use_digits(self):
     passp = Passphrase()
     passp.separator = ''
     passp.passwordlen = 5
     passp.password_use_lowercase = False
     passp.password_use_uppercase = False
     passp.password_use_digits = True
     passp.password_use_punctuation = False
     passp.generate_password()
     self.assertRegex(str(passp), r'[\d]+')
Example #2
0
 def test_password_use_punctuation(self):
     passp = Passphrase()
     passp.separator = ''
     passp.passwordlen = 5
     passp.password_use_lowercase = False
     passp.password_use_uppercase = False
     passp.password_use_digits = False
     passp.password_use_punctuation = True
     passp.generate_password()
     self.assertRegex(
         str(passp),
         r'[\!\"\#\$\%\&\\\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\]\^\_'
         r'\`\{\|\}\~]+')
Example #3
0
 def test_generate_password(self):
     length = randint(0, 10)
     passp = Passphrase()
     passp.passwordlen = length
     passphrase = passp.generate_password()
     self.assertIsInstance(passphrase, list)
     self.assertEqual(len(passphrase), length)