-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_rules_password.py
32 lines (24 loc) · 1.15 KB
/
test_rules_password.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import unittest
from rules_password import *
class TestRulesPassword(unittest.TestCase):
def test_min_size(self):
self.assertEqual(min_size("Alfredo", 7), True)
self.assertEqual(min_size("Alfredo", 8), False)
def test_min_upper_case(self):
self.assertEqual(min_upper_case("TesteSenhaForte!123&", 2), True)
self.assertEqual(min_upper_case("TesteSenhaForte!123&", 10), False)
def test_min_lower_case(self):
self.assertEqual(min_lower_case("senHA123", 2), True)
self.assertEqual(min_lower_case("senHA123", 7), False)
def test_min_digit(self):
self.assertEqual(min_digit("python12345", 3), True)
self.assertEqual(min_digit("python12345", 6), False)
def test_min_special_chars(self):
self.assertEqual(min_special_chars("graphQL$!?", 1), True)
self.assertEqual(min_special_chars("graphQL$!?", 8), False)
def test_no_repeted(self):
self.assertEqual(no_repeted("testeteste", 0), True)
self.assertEqual(no_repeted("teesteteste", 0), False)
self.assertEqual(no_repeted("teeesteteste", 0), False)
if __name__ == "__main__":
unittest.main()