Refactored function_test.py