feat: add Python integration tests for HTTP endpoints

This commit is contained in:
2026-07-16 09:56:55 +03:00
parent 5ca6927baa
commit b1f7125126
4 changed files with 244 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
"""Smoke tests for pipeline-runner REST API endpoints."""
import pytest
import requests
test_get_endpoints = [
("api/pipelines", 200, list),
("api/runs/nonexistent-id/status", 404, dict),
]
@pytest.mark.parametrize("endpoint,expected_status,expected_type", test_get_endpoints)
def test_get_endpoints(pipeline_server, endpoint, expected_status, expected_type):
"""Check HTTP status code and response content-type for GET endpoints."""
response = requests.get(f"{pipeline_server.base_url}/{endpoint}")
assert response.status_code == expected_status
assert "application/json" in response.headers.get("Content-Type", "")
data = response.json()
assert isinstance(data, expected_type)
def test_cors_headers(pipeline_server):
"""Check that CORS headers are present on responses."""
response = requests.get(f"{pipeline_server.base_url}/api/pipelines")
assert response.headers.get("Access-Control-Allow-Origin") == "*"