Buckets:
AnonymousSpottedToad/human_verified_bucket / codebase /python /inteliver_inteliver /tests /test_main.py
| from unittest.mock import AsyncMock, MagicMock, patch | |
| import pytest | |
| from fastapi import FastAPI | |
| from httpx import AsyncClient | |
| from inteliver.config import settings | |
| from inteliver.main import app, run_service | |
| from inteliver.version import __version__ | |
| def test_app_initialization(): | |
| """ | |
| Test that the FastAPI app is initialized with the correct settings. | |
| """ | |
| assert isinstance(app, FastAPI) | |
| assert app.version == __version__ | |
| def test_run_service(): | |
| """ | |
| Test that `run_service` calls `uvicorn.run` with the correct parameters. | |
| """ | |
| with patch("inteliver.main.uvicorn.run", new_callable=MagicMock) as mock_run: | |
| run_service() | |
| mock_run.assert_called_once_with( | |
| app, host=settings.app_api_host, port=settings.app_api_port | |
| ) | |
| async def test_service_up_and_running(test_client: AsyncClient): | |
| """ | |
| Test that the service is up and responds to HTTP requests. | |
| """ | |
| response = await test_client.get("/") | |
| assert response.status_code == 200 | |
Xet Storage Details
- Size:
- 1.04 kB
- Xet hash:
- 5c7c77da46b70d5feeebc702ee6b5158dbe42500ad698b237f37a0421e263159
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.