refactor: add Settings singleton pattern for config management
This commit is contained in:
17
test_rpc.py
17
test_rpc.py
@@ -1,14 +1,11 @@
|
||||
import os
|
||||
from sabatron_tryton_rpc_client.client import Client
|
||||
import datetime
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
client = Client(
|
||||
hostname=os.environ.get("TRYTON_HOSTNAME", "localhost"),
|
||||
database=os.environ.get("TRYTON_DATABASE", "tryton"),
|
||||
username=os.environ.get("TRYTON_USERNAME", "admin"),
|
||||
password=os.environ.get("TRYTON_PASSWORD", ""),
|
||||
port=int(os.environ.get("TRYTON_PORT", 8000)),
|
||||
)
|
||||
sys.path.insert(0, str(Path(__file__).parent / "src"))
|
||||
|
||||
from tryton_mcp.config import settings
|
||||
|
||||
client = settings.get_client()
|
||||
|
||||
client.connect()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user