Esempio n. 1
0
 def test_nonums(self):
     rules = pc._rules_dictionary(length=10,
                                  must_have_numbers=False,
                                  must_have_caps=True)
     for pw in nonums_passw:
         with self.subTest(i=pw):
             self.assertTrue(pc.password_check(pw, rules))
Esempio n. 2
0
 def test_strong(self):
     rules = pc._rules_dictionary(length=20)
     for pw in strong_passw:
         with self.subTest(i=pw):
             self.assertFalse(pc.password_check(pw, rules))
Esempio n. 3
0
 def test_superlong(self):
     rules = pc._rules_dictionary(length=20)
     self.assertTrue(pc.password_check('Aabcdvwxyz101abcdewxyzZ', rules))
Esempio n. 4
0
 def test_short(self):
     rules = pc._rules_dictionary(length=4)
     for pw in short_passw:
         with self.subTest(i=pw):
             self.assertTrue(pc.password_check(pw, rules))
Esempio n. 5
0
 def test_supershort(self):
     rules = pc._rules_dictionary(length=4)
     self.assertFalse(pc.password_check('ab1', rules))
Esempio n. 6
0
 def test_nonums(self):
     rules = pc._rules_dictionary()
     for pw in nonums_passw:
         with self.subTest(i=pw):
             self.assertFalse(pc.password_check(pw, rules))
Esempio n. 7
0
def wrapped_password_check():
    password = request.get_json()['password']
    result = password_check(password, _rules_dictionary())
    return jsonify(result)