Initial commit with translated description
This commit is contained in:
34
tests/README.md
Normal file
34
tests/README.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# Unit Tests
|
||||
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
# Install test dependencies
|
||||
pip install -r requirements-test.txt
|
||||
|
||||
# Run tests
|
||||
pytest
|
||||
|
||||
# Run with coverage
|
||||
pytest --cov=scripts --cov-report=html
|
||||
|
||||
# Run specific test file
|
||||
pytest tests/test_portfolio.py
|
||||
```
|
||||
|
||||
## Test Structure
|
||||
|
||||
- `test_portfolio.py` - Portfolio CRUD operations
|
||||
- `test_fetch_news.py` - RSS feed parsing with mocked responses
|
||||
- `test_setup.py` - Setup wizard validation
|
||||
- `fixtures/` - Sample RSS and portfolio data
|
||||
|
||||
## Coverage Target
|
||||
|
||||
60%+ coverage for core functions (portfolio, fetch_news, setup).
|
||||
|
||||
## Notes
|
||||
|
||||
- Tests use `tmp_path` for file isolation
|
||||
- Network calls are mocked with `unittest.mock`
|
||||
- `pytest-mock` provides `mocker` fixture for advanced mocking
|
||||
Reference in New Issue
Block a user