Buckets:

download
raw
1.12 kB
"""API Module Tests"""
import pytest
from fastapi.testclient import TestClient
from api.auth import create_access_token
# Test basic imports
from api.main import app
from api.schemas import ScanCreate, ScanResponse
from database.models import init_db
init_db()
client = TestClient(app)
def test_app_exists():
"""Test that app exists."""
assert app is not None
def test_create_access_token():
"""Test token creation."""
token = create_access_token({"sub": "test@example.com"})
assert token is not None
assert isinstance(token, str)
def test_scan_create_schema():
"""Test ScanCreate schema."""
scan = ScanCreate(
name="Test Scan",
target="example.com",
scan_type="network",
)
assert scan.target == "example.com"
assert scan.name == "Test Scan"
def test_api_root():
"""Test API root endpoint."""
response = client.get("/")
assert response.status_code in [200, 307, 404, 429]
def test_health_check():
"""Test health check endpoint."""
response = client.get("/health")
assert response.status_code in [200, 404, 429]

Xet Storage Details

Size:
1.12 kB
·
Xet hash:
774634aaf5c00866a1edf4f1f17cdee5f8bd6e96824b6169fbe089cbcc921e46

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.