bmc_hub/keepforlater/test_manual.py
Christian a604a3cc44 Add comprehensive test suite for vTiger integration and ticket module
- Implemented test scripts for vTiger account retrieval, contact data, and modules.
- Created a detailed test suite for the ticket module, covering database schema validation, ticket number generation, prepaid card constraints, and service logic.
- Added tests for vTiger field inspection and various queries related to accounts and sales orders.
- Introduced SQL migration scripts for the ALSO Cloud Billing foundation, including import jobs, lines, and mapping tables with necessary constraints and indices.
- Enhanced workflow columns in the import lines table to support matching and validation timestamps.
2026-06-20 03:29:51 +02:00

24 lines
738 B
Python

import urllib.request
import json
import sys
URL = "http://127.0.0.1:8000"
def test_endpoint(path, expected_status=200):
try:
req = urllib.request.Request(URL + path)
with urllib.request.urlopen(req) as response:
if response.status == expected_status:
print(f"{path} returned {response.status}")
return json.loads(response.read().decode())
else:
print(f"{path} returned {response.status}")
except Exception as e:
print(f"{path} failed: {e}")
print("Running Manual Module Smoke Tests...")
test_endpoint("/api/v1/manual")
test_endpoint("/api/v1/manual?limit=1")
test_endpoint("/api/v1/manual?search=test")
print("Done!")