Initial commit: Complete project-bootstrap tool
- Bootstrap script for creating monorepo projects - FastAPI backend templates with uv, ruff, mypy, pytest - React frontend templates with TypeScript, ESLint, Prettier - Docker Compose setup with backend, frontend, and database - 9 development and CI scripts - Gitea Actions CI/CD workflows - Comprehensive documentation (8 files) - 45 template files for complete project structure - Automated verification script (all tests pass) - Based on coding-agent-rules standards
This commit is contained in:
12
templates/backend/tests/conftest.py
Normal file
12
templates/backend/tests/conftest.py
Normal file
@@ -0,0 +1,12 @@
|
||||
"""Test configuration and fixtures."""
|
||||
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from app.main import app
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client() -> TestClient:
|
||||
"""Create test client."""
|
||||
return TestClient(app)
|
||||
22
templates/backend/tests/integration/test_api/test_health.py
Normal file
22
templates/backend/tests/integration/test_api/test_health.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""Integration tests for health endpoints."""
|
||||
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
|
||||
def test_health_endpoint(client: TestClient) -> None:
|
||||
"""Test health check endpoint."""
|
||||
response = client.get("/health")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.json() == {"status": "healthy"}
|
||||
|
||||
|
||||
def test_root_endpoint(client: TestClient) -> None:
|
||||
"""Test root endpoint."""
|
||||
response = client.get("/")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert "message" in data
|
||||
assert "version" in data
|
||||
assert data["version"] == "0.1.0"
|
||||
24
templates/backend/tests/unit/test_core/test_config.py
Normal file
24
templates/backend/tests/unit/test_core/test_config.py
Normal file
@@ -0,0 +1,24 @@
|
||||
"""Tests for core configuration."""
|
||||
|
||||
from app.core.config import Settings, get_settings
|
||||
|
||||
|
||||
def test_settings_default_values() -> None:
|
||||
"""Test that settings have correct default values."""
|
||||
settings = Settings()
|
||||
|
||||
assert settings.app_name == "backend"
|
||||
assert settings.app_version == "0.1.0"
|
||||
assert settings.debug is False
|
||||
assert settings.log_level == "INFO"
|
||||
assert settings.api_host == "0.0.0.0"
|
||||
assert settings.api_port == 8000
|
||||
assert settings.api_prefix == "/api/v1"
|
||||
|
||||
|
||||
def test_get_settings_returns_cached_instance() -> None:
|
||||
"""Test that get_settings returns the same instance."""
|
||||
settings1 = get_settings()
|
||||
settings2 = get_settings()
|
||||
|
||||
assert settings1 is settings2
|
||||
Reference in New Issue
Block a user