forked from jesse-ai/jesse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_api_symbols.py
More file actions
53 lines (43 loc) · 1.88 KB
/
test_api_symbols.py
File metadata and controls
53 lines (43 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python3
"""
Test symbols through Jesse API
"""
import requests
import json
def test_api_symbols():
"""Test symbols through Jesse API"""
print("🧪 Тест символов через Jesse API")
print("=" * 40)
base_url = "http://localhost:9000"
token = "ef260e9aa3c673af240d17a2660480361a8e081d1ffeca2a5ed0e3219fc18567"
headers = {"Authorization": token}
try:
# Test 1: Check if CustomCSV is available
print("1️⃣ Проверяем доступные exchanges...")
response = requests.get(f"{base_url}/exchange/supported-symbols",
headers=headers,
params={"exchange": "CustomCSV"})
if response.status_code == 200:
data = response.json()
symbols = data.get('data', [])
print(f" ✅ CustomCSV доступен")
print(f" 📊 Символов: {len(symbols)}")
if symbols:
print(f" 📋 Первые 10: {symbols[:10]}")
# Check format
usdt_symbols = [s for s in symbols if s.endswith('-USDT')]
print(f" 📊 Символов с суффиксом -USDT: {len(usdt_symbols)}")
if len(usdt_symbols) == len(symbols):
print(" ✅ Все символы в формате SYMBOL-USDT")
else:
print(" ❌ Не все символы в формате SYMBOL-USDT")
else:
print(f" ❌ Ошибка: {response.status_code} - {response.text}")
return
print("\n🎉 Тест завершен!")
except Exception as e:
print(f"\n❌ Ошибка: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
test_api_symbols()