first commit

This commit is contained in:
bluebamus committed 2025-12-19 09:36:23 +09:00
commit 1ff70c7925
71 files changed
+4175

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
import pytest
from sqlalchemy import text
from app.database.session import AsyncSessionLocal, engine
@pytest.mark.asyncio
async def test_database_connection():
"""데이터베이스 연결 테스트"""
async with engine.begin() as connection:
result = await connection.execute(text("SELECT 1"))
assert result.scalar() == 1
@pytest.mark.asyncio
async def test_session_creation():
"""세션 생성 테스트"""
async with AsyncSessionLocal() as session:
result = await session.execute(text("SELECT 1"))
assert result.scalar() == 1
@pytest.mark.asyncio
async def test_database_version():
"""MySQL 버전 확인 테스트"""
async with AsyncSessionLocal() as session:
result = await session.execute(text("SELECT VERSION()"))
version = result.scalar()
assert version is not None
print(f"MySQL Version: {version}")