music-assistant-server

1.5 KBMD
README.md
1.5 KB49 lines • markdown
1# Niconico Provider Tests
2
3Test suite for the Niconico music provider in Music Assistant.
4
5## Fixtures
6
7Test fixtures are JSON snapshots of Niconico API responses used for testing converters and business logic.
8
9### Updating Fixtures
10
11Fixtures are generated using a dedicated tool repository:
12
13**[music-assistant-nicovideo-fixtures](https://github.com/Shi-553/music-assistant-nicovideo-fixtures)**
14
15To update fixtures:
16
171. Clone the fixtures repository (if not already cloned)
182. Follow setup instructions in that repository
193. Generate new fixtures with your test account: `python scripts/main.py`
204. Copy generated fixtures `cp -r /path/to/music_assistant_nicovideo_fixtures/fixture_data tests/providers/nicovideo/`
21
22**Important:** Always use a dedicated test account, never your personal account!
23
24## Running Tests
25
26```bash
27# Run all nicovideo provider tests
28pytest tests/providers/nicovideo/
29
30# Run specific test file
31pytest tests/providers/nicovideo/test_converters.py
32
33# Run with coverage
34pytest --cov=music_assistant.providers.nicovideo tests/providers/nicovideo/
35```
36
37## Test Structure
38
39```
40tests/providers/nicovideo/
41├── fixture_data/         # Fixture data from generator repository
42│   ├── fixtures/        # Static JSON fixtures (API responses)
43│   ├── fixture_type_mappings.py  # Auto-generated type mappings
44│   └── shared_types.py  # Custom fixture types
45├── fixtures/            # Fixture loading utilities
46├── __snapshots__/       # Generated snapshots for comparison
47└── test_*.py           # Test files
48```
49