homelab_automation/test_endpoints.py
Bruno Charest c3cd7c2621
Some checks failed
Tests / Backend Tests (Python) (3.10) (push) Has been cancelled
Tests / Backend Tests (Python) (3.11) (push) Has been cancelled
Tests / Backend Tests (Python) (3.12) (push) Has been cancelled
Tests / Frontend Tests (JS) (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / All Tests Passed (push) Has been cancelled
feat: Implement initial Homelab Automation API v2 with new models, routes, and core architecture, including a SQLAlchemy model refactoring script.
2026-03-03 20:18:22 -05:00

28 lines
876 B
Python

import requests
# Use the API key from .env if possible, or try a dummy one to see the error type
url = "http://localhost:8000/api/help/catalog"
headers = {
"X-API-Key": "test-key" # Will likely fail auth but show if route exists
}
try:
print(f"Calling {url}...")
response = requests.get(url, headers=headers)
print(f"Status Code: {response.status_code}")
print(f"Response: {response.text}")
except Exception as e:
print(f"Error: {e}")
# Try another route that definitely exists
url2 = "http://localhost:8000/api/help/content"
url3 = "http://localhost:8000/api/auth/me"
for url in [url2, url3]:
try:
print(f"\nCalling {url}...")
response = requests.get(url, headers=headers)
print(f"Status Code: {response.status_code}")
print(f"Response: {response.text}")
except Exception as e:
print(f"Error: {e}")