File size: 1,211 Bytes
9024ad9
 
 
2ed2bd7
9024ad9
 
2ed2bd7
9024ad9
 
 
 
 
2ed2bd7
9024ad9
 
 
2ed2bd7
9024ad9
 
 
93c9664
9024ad9
2ed2bd7
9024ad9
 
 
2ed2bd7
9024ad9
 
 
 
93c9664
2ed2bd7
9024ad9
 
 
 
2ed2bd7
9024ad9
 
 
 
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
Tests for main FastAPI application.
"""

import pytest
from fastapi.testclient import TestClient

from app.main import app


class TestMainApp:
    """Test main FastAPI application."""

    def test_root_endpoint(self, client):
        """Test root endpoint."""
        response = client.get("/")

        assert response.status_code == 200
        data = response.json()
        assert data["message"] == "Text Summarizer API"
        assert data["version"] == "4.0.0"
        assert data["docs"] == "/docs"

    def test_health_endpoint(self, client):
        """Test health check endpoint."""
        response = client.get("/health")

        assert response.status_code == 200
        data = response.json()
        assert data["status"] == "ok"
        assert data["service"] == "text-summarizer-api"
        assert data["version"] == "4.0.0"

    def test_docs_endpoint(self, client):
        """Test that docs endpoint is accessible."""
        response = client.get("/docs")
        assert response.status_code == 200

    def test_redoc_endpoint(self, client):
        """Test that redoc endpoint is accessible."""
        response = client.get("/redoc")
        assert response.status_code == 200