Initial commit: Crypto trader application

This commit is contained in:
2025-12-25 20:20:40 -05:00
commit 07a04c1bb8
47895 changed files with 2042266 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
"""Unit tests for reporting."""

View 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)