File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ def test_number_functions():
78
78
"test_jar.py does not contain at least four valid functions"
79
79
)
80
80
81
+
81
82
@check50 .check (test_student_file_passes )
82
83
def test_named_functions ():
83
84
"""test_jar.py defines test_init, test_str, test_deposit, and test_withdraw"""
@@ -89,3 +90,15 @@ def test_named_functions():
89
90
matches = re .search (rf"def\s+{ func } \s*\(" , contents )
90
91
if not matches :
91
92
raise check50 .Failure (f"{ func } not found in test_jar.py" )
93
+
94
+
95
+ @check50 .check (test_student_file_passes )
96
+ def test_valid_testing ():
97
+ """test_jar.py contains implemented functions"""
98
+
99
+ # https://stackoverflow.com/questions/845058/how-to-get-the-line-count-of-a-large-file-cheaply-in-python
100
+ with open ("test_jar.py" , "rbU" ) as t :
101
+ num_lines = sum (1 for _ in t )
102
+
103
+ if num_lines < 20 :
104
+ raise check50 .Failure ("test_jar.py functions not implemented" )
You can’t perform that action at this time.
0 commit comments