music-assistant-server
1.5 KB•MD
README.md
1.5 KB • 49 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