Files
eve-wiki-system/tests/test_esi.py

25 lines
776 B
Python

import asyncio
from src.clients.esi import ESIClient
import logging
async def test_esi():
esi = ESIClient()
try:
# Test 1: Fetch a known TypeID (e.g., Condor = 603)
print("Testing ESI: Fetching Condor (TypeID 603)...")
condor = await esi.get_type_details(603)
print(f"Success: Found {condor.get('name')}")
# Test 2: Rate Limit Test (Fetch 5 types rapidly)
print("\nTesting Rate Limiter: Fetching 5 items...")
tasks = [esi.get_type_details(603 + i) for i in range(5)]
results = await asyncio.gather(*tasks)
for res in results:
print(f" - Fetched: {res.get('name')}")
finally:
await esi.close()
if __name__ == "__main__":
asyncio.run(test_esi())