-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_service_types_api.py
More file actions
34 lines (26 loc) · 934 Bytes
/
test_service_types_api.py
File metadata and controls
34 lines (26 loc) · 934 Bytes
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
"""
Test the service types API endpoint
"""
import requests
def test_service_types_api():
"""Test the service types endpoint"""
print("=" * 60)
print("TESTING SERVICE TYPES API")
print("=" * 60)
try:
response = requests.get('http://localhost:5000/api/requests/service-types')
print(f"\nStatus Code: {response.status_code}")
print(f"\nResponse JSON:")
print(response.json())
if response.json().get('success'):
data = response.json().get('data', [])
print(f"\nTotal service types: {len(data)}")
print("\nService types structure:")
if data:
print(f"First item: {data[0]}")
print(f"Keys: {list(data[0].keys())}")
except Exception as e:
print(f"\n✗ Error: {e}")
print("\n" + "=" * 60)
if __name__ == '__main__':
test_service_types_api()