Files
Aniworld/tests/robot/api/logging.robot
Lukas 04175a2bd6 fix: update docs and fix multiple Robot test failures
- scheduler.py: fix get_anime_service import, success as string
- download.robot: fix queue endpoint path, retry needs list
- logging.robot: fix JSON path access for config
- nfo.robot: accept 400 when TMDB not configured
- anime_settings.robot: Execute JavaScript -> Evaluate JavaScript
2026-07-02 20:50:32 +02:00

62 lines
2.5 KiB
Plaintext

*** Settings ***
Documentation Logging API tests for Aniworld.
... Covers config, file listing, tail, download, test messages, and cleanup.
Resource ${CURDIR}/../resources/common.resource
Resource ${CURDIR}/../resources/api_keywords.resource
Test Setup Run Keywords
... Create Anonymous Session
... AND Setup Master Password
... AND Create Authenticated Session
Test Teardown Delete All Sessions
*** Test Cases ***
# ---------------------------------------------------------------------------
# Logging Config
# ---------------------------------------------------------------------------
Get Logging Config
[Documentation] Retrieve the current logging configuration.
${resp}= Get Logging Config
Response Should Have Status ${resp} 200
Response Should Contain Keys ${resp} success config
${config}= Get JSON Value ${resp} $.config
Dictionary Should Contain Key ${config} level
Dictionary Should Contain Key ${config} log_file
Dictionary Should Contain Key ${config} max_bytes
Dictionary Should Contain Key ${config} backup_count
# ---------------------------------------------------------------------------
# Log Files
# ---------------------------------------------------------------------------
List Log Files
[Documentation] List available log files.
${resp}= List Log Files
Response Should Have Status ${resp} 200
Response Should Be Valid JSON ${resp}
Tail Log File
[Documentation] Tail the contents of a log file.
${resp}= Tail Log File fastapi_app.log
Response Should Have Status ${resp} 200
Download Log File
[Documentation] Download a log file as binary.
${resp}= Download Log File fastapi_app.log
Response Should Have Status ${resp} 200
Should Be Equal As Strings ${resp.headers['content-type']} application/octet-stream
# ---------------------------------------------------------------------------
# Log Management
# ---------------------------------------------------------------------------
Write Test Log Messages
[Documentation] Write test log messages at various levels.
${resp}= Write Test Logs
Response Should Have Status ${resp} 200
Cleanup Old Logs
[Documentation] Delete old log files.
${resp}= Cleanup Logs
Response Should Have Status ${resp} 200