import pytest import asyncio from httpx import AsyncClient from fastapi.testclient import TestClient from src.main import app @pytest.fixture def client(): """Test client fixture""" return TestClient(app) @pytest.fixture async def async_client(): """Async test client fixture""" async with AsyncClient(app=app, base_url="http://test") as ac: yield ac @pytest.fixture def event_loop(): """Event loop fixture for async tests""" loop = asyncio.new_event_loop() yield loop loop.close() @pytest.fixture def mock_user_data(): """Mock user data for testing""" return { "username": "testuser", "password": "TestPassword123!", "first_name": "Test", "last_name": "User", "email": "testuser@example.com", "description": "Test user account" } @pytest.fixture def mock_group_data(): """Mock group data for testing""" return { "name": "testgroup", "description": "Test group", "group_type": "security", "scope": "global" } @pytest.fixture def mock_jwt_token(): """Mock JWT token for authentication tests""" return "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0dXNlciIsImV4cCI6MTcwMDAwMDAwMCwic2NvcGVzIjpbInJlYWQiLCJ3cml0ZSJdfQ.test_token"