ft_transcendence/tests/utils.py

9 lines
324 B
Python
Raw Normal View History

2023-11-06 09:53:59 -05:00
def test(func: callable, params, expected_value, title: str, description = None):
2023-11-06 08:36:28 -05:00
print(title, end=" ")
2023-11-06 09:53:59 -05:00
if (func(*params) == expected_value):
2023-11-06 08:36:28 -05:00
print("[OK]")
return
print ("[ERROR]")
print ("expected", expected_value, ", got", value)
if not description is None:
print (description)