hhh / tests /README.md
github-actions[bot]
Deploy from GitHub Actions (commit: 8b247ffacd77c0672965b8378f1d52a7dcd187ae)
9366995
# Tests
This directory contains all tests for the LLM Model Therapist Tool.
## Structure
```
tests/
β”œβ”€β”€ test_evaluators/ # Evaluator tests
β”‚ β”œβ”€β”€ test_talk_type_evaluator.py
β”‚ └── ...
β”œβ”€β”€ test_parsers/ # Parser tests
β”‚ └── test_conversation_parser.py
β”œβ”€β”€ test_services/ # Service layer tests
β”‚ β”œβ”€β”€ test_orchestrator.py
β”‚ └── test_key_manager.py
β”œβ”€β”€ test_providers/ # Provider client tests
β”‚ β”œβ”€β”€ test_openai_client.py
β”‚ └── test_huggingface_client.py
└── fixtures/ # Test data
β”œβ”€β”€ sample_conversations/
└── mock_responses/
```
## Running Tests
### Run all tests
```bash
cd /Users/ryan/Dev/LLM_Model_Therapist_Tool/web
python -m pytest tests/
```
### Run specific test module
```bash
python -m pytest tests/test_evaluators/test_talk_type_evaluator.py
```
### Run a specific test file directly
```bash
cd /Users/ryan/Dev/LLM_Model_Therapist_Tool/web
python tests/test_evaluators/test_talk_type_evaluator.py
```
### Test with command-line arguments
```bash
# Test single utterance
python tests/test_evaluators/test_talk_type_evaluator.py "I want to quit smoking"
# Test with debug mode
python tests/test_evaluators/test_talk_type_evaluator.py --debug "I want to quit smoking"
```
## Test Conventions
- Test files should be named `test_<module_name>.py`
- Test functions should be named `test_<functionality>()`
- Use fixtures from `fixtures/` directory for sample data
- Mock external API calls when possible to avoid rate limits
- Use environment variables for API keys (fallback to test keys for CI)
## Environment Variables
```bash
export HF_API_KEY="your_huggingface_key"
export OPENAI_API_KEY="your_openai_key"
```