Files
OSIT-AE-API-FastAPI/tests/archive/test_e2e_v3_event_device.py
Scott Idem 37c84de57b chore(tests): consolidate E2E test suite into standardized primary scripts
- Combined 10+ one-off tests into 4 primary functional suites (Search, Auth, Lifecycle, Vision).
- Archived original scripts to tests/archive/.
- Updated README with the new standardized inventory.
- Applied clean output formatting across the new suite.
2026-02-03 16:50:18 -05:00

61 lines
2.1 KiB
Python

import requests
import json
import sys
# Configuration
BASE_URL = "https://dev-api.oneskyit.com/v3/crud"
# Using the API key found in the database
API_KEY = "PHDXUJxx6IgmLNKxIBezTQ"
# Event Device ID found in the database
DEVICE_ID = "GZvFjgIIZQg"
def get_headers():
headers = {
"Content-Type": "application/json",
"X-Aether-API-Key": API_KEY,
"X-No-Account-ID": "bypass"
}
return headers
def test_get_event_device():
print(f"--- Testing: Get Event Device by ID ({DEVICE_ID}) ---")
url = f"{BASE_URL}/event_device/{DEVICE_ID}"
headers = get_headers()
try:
response = requests.get(url, headers=headers)
print(f"URL: {response.url}")
print(f"Status Code: {response.status_code}")
if response.status_code == 200:
data = response.json().get('data', {})
print("✅ SUCCESS: Found Event Device.")
# Verify Vision ID pattern (Strings only for ID fields)
vision_fields = ["id", "event_device_id", "account_id", "event_id", "event_location_id"]
for field in vision_fields:
val = data.get(field)
print(f" Field '{field}': {val} (type: {type(val).__name__})")
if val is not None:
assert isinstance(val, str), f"Error: Field '{field}' should be a string, but got {type(val).__name__}"
# Check for any unexpected integer IDs
for key, val in data.items():
if key.endswith("_id") and not key.endswith("external_id"):
if isinstance(val, int):
print(f" ❌ FAILURE: Integer leakage detected in field '{key}': {val}")
# assert False, f"Integer leakage in '{key}'"
else:
print(f"❌ FAILURE: {response.text}")
except Exception as e:
print(f"Error during test: {e}")
print("-" * 40 + "\n")
if __name__ == "__main__":
print(f"Starting Aether V3 Event Device E2E Tests against {BASE_URL}\n")
test_get_event_device()
print("Tests Complete.")