File size: 1,798 Bytes
cff1e0e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# 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"
```
|