Skip to content

Fix CSV OHLCV based tests (#331)#400

Merged
MDUYN merged 1 commit into
devfrom
fix/csv-ohlcv-based-tests-331
Mar 19, 2026
Merged

Fix CSV OHLCV based tests (#331)#400
MDUYN merged 1 commit into
devfrom
fix/csv-ohlcv-based-tests-331

Conversation

@MDUYN
Copy link
Copy Markdown
Collaborator

@MDUYN MDUYN commented Mar 19, 2026

Summary

Adds comprehensive test coverage for CSV data providers and introduces the new CSVTickerDataProvider class.

Closes #331

Changes

New: CSVTickerDataProvider

  • New data provider class that loads ticker data from OHLCV CSV files
  • Maps OHLCV columns to ticker dict format (bid, ask, last derived from Close)
  • Supports has_data(), get_data(), backtest mode, and the copy pattern
  • Exported at all package levels (__init__.py chain)

New Tests: CSVOHLCVDataProvider (19 tests)

  • Basic data loading and column validation
  • has_data() with matching/mismatched symbol, market, time_frame
  • has_data() with no dates, out-of-range end date, window_size
  • get_data() with start_date and end_date
  • Backtest mode: prepare_backtest_data() and get_backtest_data()
  • Invalid backtest ranges (start before data, end after data)
  • Custom identifier, market, and symbol properties

New Tests: CSVTickerDataProvider (7 tests)

  • Basic loading
  • has_data() with matching/mismatched symbol, market, data_type
  • get_data() returns correct ticker dict with expected keys
  • Custom identifier support

Other

  • Added test data CSV files for backtesting scenarios
  • Fixed test_trade_price_update.py data fixtures
  • All 29 CSV provider tests passing, 0 flake8 lint issues

…ests (#331)

- Add CSVTickerDataProvider class for ticker data from CSV files
- Export CSVTickerDataProvider at all package levels
- Add 19 new tests for CSVOHLCVDataProvider (has_data, get_data,
  backtest, edge cases, symbol/market/timeframe matching)
- Add 7 new tests for CSVTickerDataProvider (loading, has_data,
  get_data, symbol/market/data_type matching, custom identifier)
- Add new test data CSV files for backtesting scenarios
- Fix test_trade_price_update to use proper data fixtures
@MDUYN MDUYN merged commit 581d1d4 into dev Mar 19, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant