Download tests/unit/test_fd_utils.py from prasanthntu/asset-class-comparison: direct link, hf CLI and curl.
- Browser
- Download file 348 Bytes
-
https://huggingface.co/spaces/prasanthntu/asset-class-comparison/resolve/main/tests/unit/test_fd_utils.py
- Command line
-
hf download hf://spaces/prasanthntu/asset-class-comparison/tests/unit/test_fd_utils.py
-
curl -L -o test_fd_utils.py https://huggingface.co/spaces/prasanthntu/asset-class-comparison/resolve/main/tests/unit/test_fd_utils.py
348 Bytes
| import sys | |
| import os | |
| sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../..'))) | |
| from utils import fd_utils | |
| from datetime import date | |
| def test_calculate_fd_returns(): | |
| result = fd_utils.calculate_fd_returns(1000, 0.05, date(2020, 1, 1), date(2021, 1, 1)) | |
| # 1 year at 5% interest | |
| assert abs(result - 1050) < 1 |