File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ import checkpy .tests as t
2+ import checkpy .lib as lib
3+ import checkpy .assertlib as asserts
4+
5+ from _extensions import *
6+
7+ @t .test (0 )
8+ def checks_length (test ):
9+ def testMethod ():
10+ length = lib .getFunction ("check_length" , test .fileName )
11+ if length ("12345678" ) and length ("ThisIsAtLeast8" ) and not length ("" ) and not length ("1234567" ):
12+ return True
13+ else :
14+ return False
15+
16+ test .test = testMethod
17+ test .description = lambda : "check_length"
18+
19+
20+ @t .test (1 )
21+ def checks_letter (test ):
22+ def testMethod ():
23+ letter = lib .getFunction ("check_letter" , test .fileName )
24+ if letter ("AaBbCc" ) and not letter ("abc" ) and not letter ("ABC" ) and not letter ("123" ):
25+ return True
26+ else :
27+ return False
28+
29+ test .test = testMethod
30+ test .description = lambda : "check_letter"
31+
32+
33+ @t .test (2 )
34+ def checks_number (test ):
35+ def testMethod ():
36+ number = lib .getFunction ("check_number" , test .fileName )
37+ if number ("123" ) and number ("Hello123" ) and not number ("Hello" ) and number ("1" ) and number ("2" ) and number ("3" ) and number ("4" ) and number ("5" ) and number ("6" ) and number ("7" ) and number ("8" ) and number ("9" ) and number ("0" ):
38+ return True
39+ else :
40+ return False
41+
42+ test .test = testMethod
43+ test .description = lambda : "check_number"
44+
45+ @t .test (3 )
46+ def checks_password (test ):
47+ def testMethod ():
48+ password = lib .getFunction ("check_password" , test .fileName )
49+ if password ("AardappelTester123" ) and not password ("hoi" ) and not password ("Practitioner" ) and not password ("Arb1ter" ) and not password ("shopkeeper" ) and not password ("12345678" ) and not password ("1234" ):
50+ return True
51+ else :
52+ return False
53+
54+ test .test = testMethod
55+ test .description = lambda : "check_password"
You can’t perform that action at this time.
0 commit comments