Add tests

This commit is contained in:
Yunxiao Xu
2025-09-19 05:29:27 -07:00
parent b08bab5266
commit 47a1f3c9a9
4 changed files with 183 additions and 1 deletions

View File

@@ -75,7 +75,33 @@ Install the built wheel elsewhere:
uv pip install dist/*.whl
```
## Testing
Run the included unit tests with the standard library `unittest` runner.
```bash
# Using uv
uv run python -m unittest discover -s tests -v
# Or with an activated venv
python -m unittest discover -s tests -v
```
Run a single test file:
```bash
uv run python -m unittest tests/test_api.py -v
```
## Development
Run directly from source without installing (useful while iterating):
```bash
PYTHONPATH=src uv run python -m hysteria_panel
```
## Troubleshooting
- No module named `hysteria-panel`: ensure the project is installed (`uv sync` or `pip install -e .`).
- No module named `hysteria_panel`: ensure the project is installed (`uv sync` or `pip install -e .`).
- Cannot connect: verify host/port/secret and whether HTTPS is required.