forked from tdwojak/Python2017
Add test task
This commit is contained in:
parent
344d78c03a
commit
2fb0d1192d
22
labs02/test_task.py
Executable file
22
labs02/test_task.py
Executable file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
def suma(a, b):
|
||||
"""
|
||||
Napisz funkcję, która zwraca sumę elementów.
|
||||
"""
|
||||
pass
|
||||
|
||||
def tests(f):
|
||||
inputs = [(2, 3), (0, 0), (1, 1)]
|
||||
outputs = [5, 0, 2]
|
||||
|
||||
for input, output in zip(inputs, outputs):
|
||||
if suma(*input) != output:
|
||||
return "ERROR: {}!={}".format(suma(*input), output)
|
||||
break
|
||||
return "TESTS PASSED"
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(tests(suma))
|
Loading…
Reference in New Issue
Block a user