示例#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))
示例#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))
示例#3
0
 def test_superlong(self):
     rules = pc._rules_dictionary(length=20)
     self.assertTrue(pc.password_check('Aabcdvwxyz101abcdewxyzZ', rules))
示例#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))
示例#5
0
 def test_supershort(self):
     rules = pc._rules_dictionary(length=4)
     self.assertFalse(pc.password_check('ab1', rules))
示例#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))
示例#7
0
def wrapped_password_check():
    password = request.get_json()['password']
    result = password_check(password, _rules_dictionary())
    return jsonify(result)