Files
v2-Docker/v2_lizenzserver/test_api.py
Claude Project Manager 0d7d888502 Initial commit
2025-07-05 17:51:16 +02:00

39 Zeilen
1.3 KiB
Python

import httpx
import asyncio
API_URL = "https://api-software-undso.z5m7q9dk3ah2v1plx6ju.com"
API_KEY = "test-api-key-12345"
async def test_license_server():
async with httpx.AsyncClient(verify=False) as client:
# Test root endpoint
print("Testing root endpoint...")
response = await client.get(f"{API_URL}/")
print(f"Status: {response.status_code}")
print(f"Response: {response.json()}\n")
# Test health endpoint
print("Testing health endpoint...")
response = await client.get(f"{API_URL}/health")
print(f"Status: {response.status_code}")
print(f"Response: {response.json()}\n")
# Test license activation (will fail without valid API key)
print("Testing license activation...")
headers = {"Authorization": f"Bearer {API_KEY}"}
data = {
"license_key": "TEST-LICENSE-KEY-12345",
"machine_id": "MACHINE001",
"hardware_hash": "abc123def456",
"app_version": "1.0.0"
}
response = await client.post(
f"{API_URL}/api/license/activate",
headers=headers,
json=data
)
print(f"Status: {response.status_code}")
print(f"Response: {response.json()}\n")
if __name__ == "__main__":
asyncio.run(test_license_server())