Add test file for data/data_loader.py

This commit introduces a new test file, `tests/test_data_loader.py`, to verify the functionality of `get_data_mt5`. It uses `unittest.mock.MagicMock` to mock the `MetaTrader5` module, allowing tests to run on Linux where the module cannot be imported.

The tests cover:
- Live trading data retrieval (`start_pos=None`).
- Backtesting data retrieval with a specific `start_pos`.
- Error handling when `copy_rates_from_pos` returns `None`.
- The proper conversion of rates into a pandas DataFrame with a parsed datetime index.

Co-authored-by: maghdam <63883156+maghdam@users.noreply.github.com>
This commit is contained in:
google-labs-jules[bot]
2026-03-11 18:37:47 +00:00
parent 29fcbf0f9d
commit 01b82a03bc
5 changed files with 74 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.