Files

29 lines
856 B
Python

# test_client.py
import os
from dotenv import load_dotenv
from superoffice_client import SuperOfficeClient
print("--- Testing Core SuperOfficeClient ---")
# Load environment variables from the root .env file
load_dotenv(dotenv_path="/home/node/clawd/.env")
try:
# Initialize the client
client = SuperOfficeClient()
# Perform a simple read operation
person_id = 1
print(f"Fetching person with ID: {person_id}...")
person_data = client.get_person(person_id)
if person_data:
print(f"✅ SUCCESS! Found Person: {person_data.get('firstname')} {person_data.get('lastname')}")
else:
print(f"❌ ERROR: Could not fetch person {person_id}, but connection was successful.")
except Exception as e:
print(f"❌ FATAL ERROR during client initialization or request: {e}")
print("--- Test complete ---")