Local changes: Updated model training, removed debug instrumentation, and configuration improvements
This commit is contained in:
2
tests/unit/reporting/__init__.py
Normal file
2
tests/unit/reporting/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
"""Unit tests for reporting."""
|
||||
|
||||
35
tests/unit/reporting/test_csv_exporter.py
Normal file
35
tests/unit/reporting/test_csv_exporter.py
Normal file
@@ -0,0 +1,35 @@
|
||||
"""Tests for CSV exporter."""
|
||||
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
from tempfile import TemporaryDirectory
|
||||
from src.reporting.csv_exporter import get_csv_exporter, CSVExporter
|
||||
|
||||
|
||||
class TestCSVExporter:
|
||||
"""Tests for CSVExporter."""
|
||||
|
||||
@pytest.fixture
|
||||
def exporter(self):
|
||||
"""Create CSV exporter instance."""
|
||||
return get_csv_exporter()
|
||||
|
||||
def test_export_trades(self, exporter, mock_database):
|
||||
"""Test exporting trades."""
|
||||
engine, Session = mock_database
|
||||
|
||||
with TemporaryDirectory() as tmpdir:
|
||||
filepath = Path(tmpdir) / "trades.csv"
|
||||
|
||||
# Export (may be empty if no trades)
|
||||
result = exporter.export_trades(filepath, paper_trading=True)
|
||||
assert isinstance(result, bool)
|
||||
|
||||
def test_export_portfolio(self, exporter):
|
||||
"""Test exporting portfolio."""
|
||||
with TemporaryDirectory() as tmpdir:
|
||||
filepath = Path(tmpdir) / "portfolio.csv"
|
||||
|
||||
result = exporter.export_portfolio(filepath)
|
||||
assert isinstance(result, bool)
|
||||
|
||||
Reference in New Issue
Block a user