1
0
forked from tdwojak/Python2017
Python2017/labs02/test_task.py
s45167 8a9a9d29af update test task
Signed-off-by: s45167 <krzysztof.spalinski@op.pl>
2017-11-19 14:54:32 +01:00

23 lines
463 B
Python
Executable File

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def suma(a, b):
"""
Napisz funkcję, która zwraca sumę elementów.
"""
return a+b
def tests(f):
inputs = [(2, 3), (0, 0), (1, 1)]
outputs = [5, 0, 2]
for input, output in zip(inputs, outputs):
if f(*input) != output:
return "ERROR: {}!={}".format(f(*input), output)
break
return "TESTS PASSED"
if __name__ == "__main__":
print(tests(suma))