# Reltio MCP Server Tests
This directory contains tests for the Reltio MCP Server.
## Test Structure
- `unit/`: Unit tests for individual components
- `test_server.py`: Tests for the server.py endpoints
- `test_main.py`: Tests for the main.py entry point
## Running Tests
To run all tests:
### Build docker image and run it on docker container
```bash
docker-compose -f docker-compose-test.yaml up -d --build
```
### OR
```bash
pytest
```
To run tests with coverage report:
```bash
pytest --cov=src --cov-report=term-missing
```
To run a specific test file:
```bash
pytest tests/unit/test_server.py
```
## Test Dependencies
The test suite requires the following packages:
- pytest
- pytest-asyncio
- pytest-cov
- pytest-mock
To install the dependencies:
```bash
pip install -r requirements_tests.txt
```
## Writing New Tests
When adding new tests:
1. Place unit tests in the `tests/unit/` directory
2. Use the naming convention `test_*.py` for test files
3. Use the naming convention `Test*` for test classes
4. Use the naming convention `test_*` for test functions
5. Use the `@pytest.mark.asyncio` decorator for async tests