forked from AMC-IITBHU/Assignments-2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.test.py.save
42 lines (38 loc) · 1.3 KB
/
.test.py.save
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
33
34
35
36
37
38
39
40
41
42
import work
funcs = [work.demo, work.is_palindrome, work.sqrt_of_numbers, work.Maximum, work.even_sort, work.eqn_solver]
debug = False
test_cases = {
'demo' : [
[1,1]
],
'is_palindrome' : [
['malayalam',True]
],
'sqrt_of_numbers' : [
[1,1.0]
],
'Maximum' : [
[[0,1,2],(2,1)]
],
'even_sort' : [
[[1,2,3,4],[2,4,1,3]]]
,
'eqn_solver' : [[]],
} ## Will be filled after submission date
score = 0
for func in funcs:
flag = 1
for i,test_case in enumerate(test_cases[func.__name__]):
x, y = test_case
try:
assert y==func(*x)
except Exception as e:
flag = 1
print("function "+func.__name__+" fails on testcase "+str(i+1),end="")
if debug:
print("because ")
print(e)
else:
print("")
score += flag
print("Your score is "+str(score)+"!!, You will receive extra points for smart implementation directly in the pull request")