Testing functions in Python