Format: Apply code and markdown formatting fixes

This commit is contained in:
Lukas 2025-11-28 17:47:39 +01:00
parent 6e9087d0f4
commit ddff43595f
3 changed files with 23 additions and 19 deletions

View File

@ -134,11 +134,11 @@ All series-related WebSocket events include `key` as the primary identifier in t
### AnimeSeries Identifier Fields
| Field | Type | Purpose |
| ------ | ----------- | ------------------------------------------------- |
| `id` | Primary Key | Internal database key for relationships |
| `key` | Unique, Indexed | **PRIMARY IDENTIFIER** for all lookups |
| `folder` | String | Filesystem metadata only (not for identification) |
| Field | Type | Purpose |
| -------- | --------------- | ------------------------------------------------- |
| `id` | Primary Key | Internal database key for relationships |
| `key` | Unique, Indexed | **PRIMARY IDENTIFIER** for all lookups |
| `folder` | String | Filesystem metadata only (not for identification) |
**Database Service Methods:**

View File

@ -196,12 +196,13 @@ conda run -n AniWorld python -m pytest tests/ -v
```
**Completion Notes:**
- Updated `FakeSerie` and `FakeSeriesApp` in `test_anime_endpoints.py` with realistic keys
- Updated fixtures in `test_websocket_integration.py` (6+ fixtures)
- Updated fixtures in `test_download_progress_integration.py` (5 fixtures)
- Updated fixtures in `test_download_progress_websocket.py` (9 fixtures)
- Updated fixtures in `test_download_models.py` (10+ fixtures)
- All fixtures now use URL-safe, lowercase, hyphenated key format
- Updated `FakeSerie` and `FakeSeriesApp` in `test_anime_endpoints.py` with realistic keys
- Updated fixtures in `test_websocket_integration.py` (6+ fixtures)
- Updated fixtures in `test_download_progress_integration.py` (5 fixtures)
- Updated fixtures in `test_download_progress_websocket.py` (9 fixtures)
- Updated fixtures in `test_download_models.py` (10+ fixtures)
- All fixtures now use URL-safe, lowercase, hyphenated key format
---
@ -230,13 +231,14 @@ conda run -n AniWorld python -m pytest tests/ -v
- [x] All integration tests pass (10 tests)
**Completion Notes:**
- Created comprehensive test file with 10 tests:
- `TestAPIIdentifierConsistency`: 2 tests for API response validation
- `TestServiceIdentifierConsistency`: 2 tests for download service key usage
- `TestWebSocketIdentifierConsistency`: 2 tests for WebSocket events
- `TestIdentifierValidation`: 2 tests for model validation
- `TestEndToEndIdentifierFlow`: 2 tests for full flow verification
- Tests use UUID suffixes for isolation to prevent state leakage
- Created comprehensive test file with 10 tests:
- `TestAPIIdentifierConsistency`: 2 tests for API response validation
- `TestServiceIdentifierConsistency`: 2 tests for download service key usage
- `TestWebSocketIdentifierConsistency`: 2 tests for WebSocket events
- `TestIdentifierValidation`: 2 tests for model validation
- `TestEndToEndIdentifierFlow`: 2 tests for full flow verification
- Tests use UUID suffixes for isolation to prevent state leakage
**Test Command:**

View File

@ -153,6 +153,7 @@ class TestAPIIdentifierConsistency:
- Both fields are present and distinct
"""
import uuid
# Add an item first with unique key
unique_suffix = str(uuid.uuid4())[:8]
unique_key = f"one-piece-{unique_suffix}"
@ -319,7 +320,7 @@ class TestServiceIdentifierConsistency:
- Data can be restored with correct identifiers
"""
import json
# Add item to queue
await download_service.add_to_queue(
serie_id="jujutsu-kaisen",
@ -470,6 +471,7 @@ class TestEndToEndIdentifierFlow:
- All responses contain correct identifiers
"""
import uuid
# Use unique key to avoid conflicts with other tests
unique_suffix = str(uuid.uuid4())[:8]
unique_key = f"bleach-tybw-{unique_suffix}"