Initialize system repository: agents, infra, and configuration
This commit is contained in:
24
tests/test_esi.py
Normal file
24
tests/test_esi.py
Normal file
@@ -0,0 +1,24 @@
|
||||
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())
|
||||
Reference in New Issue
Block a user