# tests/conftest.py
"""
Pytest configuration and fixtures for FCTR Okta MCP Server tests.
"""
import pytest
import sys
from pathlib import Path
# Add src to path for imports
src_path = Path(__file__).parent.parent / "src"
sys.path.insert(0, str(src_path))
@pytest.fixture
def sample_safe_code():
"""Sample safe code that should pass validation."""
return '''
async def execute_query(client):
response = await client.make_request(
endpoint="/api/v1/users",
method="GET",
params={"limit": 100}
)
return response.get("data", [])
'''
@pytest.fixture
def sample_dangerous_code():
"""Sample dangerous code that should fail validation."""
return 'import os; os.system("echo pwned")'
@pytest.fixture
def sample_okta_response():
"""Sample Okta API response for testing."""
return {
"status": "success",
"data": [
{
"id": "00u123abc",
"status": "ACTIVE",
"profile": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"login": "john.doe@example.com"
}
},
{
"id": "00u456def",
"status": "ACTIVE",
"profile": {
"firstName": "Jane",
"lastName": "Smith",
"email": "jane.smith@example.com",
"login": "jane.smith@example.com"
}
}
]
}