init
This commit is contained in:
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
38
tests/test_api.py
Normal file
38
tests/test_api.py
Normal file
@@ -0,0 +1,38 @@
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
from app.main import app
|
||||
|
||||
client = TestClient(app)
|
||||
|
||||
|
||||
def test_root():
|
||||
"""Test root endpoint"""
|
||||
response = client.get("/")
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert "message" in data
|
||||
assert "version" in data
|
||||
|
||||
|
||||
def test_health():
|
||||
"""Test health check endpoint"""
|
||||
response = client.get("/health")
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert data["status"] == "healthy"
|
||||
|
||||
|
||||
# Add more tests as needed
|
||||
# def test_upload_artifact():
|
||||
# """Test artifact upload"""
|
||||
# files = {"file": ("test.csv", b"test,data\n1,2", "text/csv")}
|
||||
# data = {
|
||||
# "test_name": "sample_test",
|
||||
# "test_suite": "unit",
|
||||
# "test_result": "pass"
|
||||
# }
|
||||
# response = client.post("/api/v1/artifacts/upload", files=files, data=data)
|
||||
# assert response.status_code == 201
|
||||
# artifact = response.json()
|
||||
# assert artifact["filename"] == "test.csv"
|
||||
# assert artifact["test_name"] == "sample_test"
|
||||
Reference in New Issue
Block a user