Skip to content

Commit a28990e

Browse files
authored
Update __init__.py
1 parent ddeb940 commit a28990e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

jar/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def test_number_functions():
7878
"test_jar.py does not contain at least four valid functions"
7979
)
8080

81+
8182
@check50.check(test_student_file_passes)
8283
def test_named_functions():
8384
"""test_jar.py defines test_init, test_str, test_deposit, and test_withdraw"""
@@ -89,3 +90,15 @@ def test_named_functions():
8990
matches = re.search(rf"def\s+{func}\s*\(", contents)
9091
if not matches:
9192
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")

0 commit comments

Comments
 (0)