File size: 1,055 Bytes
3f61e65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import pytest
from fastapi.testclient import TestClient
from app.main import app

client = TestClient(app)

def test_beta_verification():
    response = client.post("/api/beta/verify", json={"application_id": "test123"})
    assert response.status_code == 200
    assert response.json()["message"] == "Access granted"

def test_jwt_authentication():
    response = client.post("/api/auth/token", data={"username": "admin@synthex.com", "password": "admin123"})
    assert response.status_code == 200
    assert "access_token" in response.json()

def test_record_generation():
    # First, get a token
    token_response = client.post("/api/auth/token", data={"username": "admin@synthex.com", "password": "admin123"})
    token = token_response.json()["access_token"]

    # Then, generate records
    response = client.post(
        "/api/generator/generate",
        json={"recordType": "Clinical Note", "quantity": 5},
        headers={"Authorization": f"Bearer {token}"}
    )
    assert response.status_code == 200
    assert len(response.json()) == 5