Luxx/tests/conftest.py

33 lines
806 B
Python

"""Pytest configuration and fixtures"""
import os
import sys
import pytest
from pathlib import Path
# Add project root to path
project_root = Path(__file__).parent.parent
sys.path.insert(0, str(project_root))
# Set test environment variables
os.environ.setdefault("APP_SECRET_KEY", "test-secret-key-for-testing")
os.environ.setdefault("DEEPSEEK_API_KEY", "test-api-key")
@pytest.fixture
def sample_workspace(tmp_path):
"""Create a temporary workspace for testing"""
workspace = tmp_path / "test_workspace"
workspace.mkdir()
return workspace
@pytest.fixture
def sample_user_context():
"""Sample user context for tool testing"""
return {
"user_id": 1,
"username": "test_user",
"workspace": "/tmp/test_workspace",
"user_permission_level": 3
}