- Added pytest configuration and test suite - Added TypeScript configuration for both frontend apps - Removed duplicate migration files from backend/backend/migrations/ - Enhanced project structure for better testing and development"
50 lines
1.4 KiB
Python
50 lines
1.4 KiB
Python
"""
|
|
Tests for Health Check endpoints - ServiceManagerWeb
|
|
|
|
Tests básicos para verificar que la configuración de testing funciona
|
|
"""
|
|
|
|
import pytest
|
|
import asyncio
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_health_check_async():
|
|
"""Test that async operations work in testing."""
|
|
# Simple async test to verify setup
|
|
await asyncio.sleep(0.01)
|
|
assert True
|
|
|
|
|
|
def test_basic_math():
|
|
"""Test basic functionality."""
|
|
assert 1 + 1 == 2
|
|
|
|
|
|
# Test básico de importación de módulos principales
|
|
def test_imports():
|
|
"""Test that core modules can be imported without errors."""
|
|
try:
|
|
from app.core.config import get_settings
|
|
from app.core.security import security
|
|
|
|
# Test que las funciones básicas existen
|
|
assert get_settings is not None
|
|
assert security is not None
|
|
assert hasattr(security, 'hash_password')
|
|
assert hasattr(security, 'verify_password')
|
|
|
|
except ImportError as e:
|
|
pytest.fail(f"Failed to import core modules: {e}")
|
|
|
|
|
|
def test_security_functions():
|
|
"""Test basic security functions."""
|
|
from app.core.security import security
|
|
|
|
password = "TestPassword123!"
|
|
hashed = security.hash_password(password)
|
|
|
|
assert hashed != password # Should be hashed
|
|
assert security.verify_password(password, hashed) # Should verify
|
|
assert not security.verify_password("wrong", hashed) # Should not verify wrong password |