feat(v0.2.0): complete data pipeline with loaders, database, and validation

This commit is contained in:
0x_n3m0_
2026-01-05 11:54:04 +02:00
parent b5e7043df6
commit 0079127ade
7 changed files with 792 additions and 124 deletions

View File

@@ -38,11 +38,11 @@ def test_create_and_retrieve_ohlcv(temp_db):
with get_db_session() as session:
repo = OHLCVRepository(session=session)
# Create record
# Create record with unique timestamp
record = OHLCVData(
symbol="DAX",
timeframe=Timeframe.M1,
timestamp=datetime(2024, 1, 1, 3, 0, 0),
timestamp=datetime(2024, 1, 1, 2, 0, 0), # Different hour to avoid collision
open=100.0,
high=100.5,
low=99.5,
@@ -88,11 +88,12 @@ def test_batch_create_ohlcv(temp_db):
assert len(created) == 10
# Verify all records saved
# Query from 03:00 to 03:09 (we created records for i=0 to 9)
retrieved = repo.get_by_timestamp_range(
"DAX",
Timeframe.M1,
base_time,
base_time + timedelta(minutes=10),
base_time + timedelta(minutes=9),
)
assert len(retrieved) == 10
@@ -104,8 +105,8 @@ def test_get_by_timestamp_range(temp_db):
with get_db_session() as session:
repo = OHLCVRepository(session=session)
# Create records
base_time = datetime(2024, 1, 1, 3, 0, 0)
# Create records with unique timestamp range (4 AM hour)
base_time = datetime(2024, 1, 1, 4, 0, 0)
for i in range(20):
record = OHLCVData(
symbol="DAX",