-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathverify_endpoints.py
More file actions
executable file
·76 lines (62 loc) · 2.39 KB
/
verify_endpoints.py
File metadata and controls
executable file
·76 lines (62 loc) · 2.39 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env python3
"""
Verify that all 287 BMRS API endpoints are accessible through the client.
This script checks that the BMRSClient properly inherits from GeneratedBMRSMethods
and that all endpoints are available.
"""
def verify_endpoints():
"""Verify all 287 endpoints are accessible."""
try:
from elexon_bmrs import BMRSClient
# Create client instance
client = BMRSClient()
# Get all get_ methods
methods = [m for m in dir(client) if m.startswith('get_')]
print(f"✅ Total get_ methods found: {len(methods)}")
if len(methods) == 287:
print("🎉 SUCCESS: All 287 endpoints are accessible!")
else:
print(f"❌ ERROR: Expected 287 methods, found {len(methods)}")
return False
# Test a few key methods exist
key_methods = [
'get_balancing_dynamic',
'get_generation_actual_per_type',
'get_demand_outturn_national',
'get_datasets_freq',
'get_system_frequency'
]
print("\n🔍 Testing key methods:")
for method in key_methods:
if hasattr(client, method):
print(f" ✅ {method}")
else:
print(f" ❌ {method} - MISSING!")
return False
# Test method documentation
print("\n📚 Testing method documentation:")
try:
help_text = help(client.get_balancing_dynamic)
print(" ✅ Method documentation accessible")
except Exception as e:
print(f" ❌ Method documentation error: {e}")
return False
print("\n🎯 All verification tests passed!")
return True
except ImportError as e:
print(f"❌ Import error: {e}")
print("Make sure to install the package: pip install -e .")
return False
except Exception as e:
print(f"❌ Unexpected error: {e}")
return False
if __name__ == "__main__":
print("🔍 Verifying BMRS API Client Endpoints")
print("=" * 50)
success = verify_endpoints()
if success:
print("\n✅ VERIFICATION COMPLETE: All 287 endpoints are properly accessible!")
exit(0)
else:
print("\n❌ VERIFICATION FAILED: Some endpoints are missing or inaccessible.")
exit(1)