all working

This commit is contained in:
HotSwapp
2025-08-10 21:34:11 -05:00
parent 14ee479edc
commit 1512b2d12a
22 changed files with 1453 additions and 489 deletions

View File

@@ -3,11 +3,29 @@
Test script for the customers module
"""
import requests
import pytest
import json
from datetime import datetime
BASE_URL = "http://localhost:6920"
@pytest.fixture(scope="module")
def token():
"""Obtain an access token from the running server, or skip if unavailable."""
try:
response = requests.post(f"{BASE_URL}/api/auth/login", json={
"username": "admin",
"password": "admin123"
}, timeout=3)
if response.status_code == 200:
data = response.json()
if data and data.get("access_token"):
return data["access_token"]
except Exception:
pass
pytest.skip("Auth server not available; skipping integration tests")
def test_auth():
"""Test authentication"""
print("🔐 Testing authentication...")