fix: return 201 on backup create
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1,11 +1,3 @@
|
|||||||
### Task 3: Fix `Validate Valid Config` API Test
|
|
||||||
**Test Result:** FAIL — Expected status: 200, got 422
|
|
||||||
**File:** `tests/robot/api/config.robot`
|
|
||||||
**Instructions:**
|
|
||||||
The test POSTs to `/api/config/validate` with `logging={'level': 'INFO', 'file': None, 'max_bytes': None, 'backup_count': 3}`. The server returns 422. Open `src/server/models/config.py` and inspect the `LoggingConfig` Pydantic model. The `file` and `max_bytes` fields likely do not accept `None` (or the model requires strings/ints). Update the model so `file: Optional[str] = None` and `max_bytes: Optional[int] = None`, or adjust the test payload to omit `None` values. Ensure the validation endpoint returns 200 for well-formed configs.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Task 4: Fix `Config Backup Create` API Test
|
### Task 4: Fix `Config Backup Create` API Test
|
||||||
**Test Result:** FAIL — Expected status: 201, got 200
|
**Test Result:** FAIL — Expected status: 201, got 200
|
||||||
**File:** `tests/robot/api/config.robot` and `src/server/api/config.py`
|
**File:** `tests/robot/api/config.robot` and `src/server/api/config.py`
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ def list_backups(
|
|||||||
) from e
|
) from e
|
||||||
|
|
||||||
|
|
||||||
@router.post("/backups", response_model=Dict[str, str])
|
@router.post("/backups", response_model=Dict[str, str], status_code=status.HTTP_201_CREATED)
|
||||||
def create_backup(
|
def create_backup(
|
||||||
name: Optional[str] = None, auth: dict = Depends(require_auth)
|
name: Optional[str] = None, auth: dict = Depends(require_auth)
|
||||||
) -> Dict[str, str]:
|
) -> Dict[str, str]:
|
||||||
|
|||||||
Reference in New Issue
Block a user