Files
service-finder/backend/app/tests/e2e/test_robot.py
2026-03-22 11:02:05 +00:00

23 lines
836 B
Python
Executable File

# Tell pytest to skip this module - it's a standalone script, not a test
__test__ = False
import asyncio
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
from sqlalchemy.orm import sessionmaker
from app.services.harvester_robot import VehicleHarvester
from app.core.config import settings
# Adatbázis kapcsolat felépítése a pontos névvel
engine = create_async_engine(str(settings.DATABASE_URL))
AsyncSessionLocal = sessionmaker(engine, class_=AsyncSession, expire_on_commit=False)
async def run_test():
async with AsyncSessionLocal() as db:
harvester = VehicleHarvester()
print("🚀 Robot indítása...")
# Megpróbáljuk betölteni a katalógust
await harvester.harvest_all(db)
print("✅ Teszt lefutott.")
if __name__ == "__main__":
asyncio.run(run_test())