mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 23:37:18 +00:00
* add support of remote task tracking * add remote call trigger implementation * docs update * add cross-service upload * add notes about user * add more ability to control upload * multipart upload with signatures as well as safe file save * configuration reference update * rename watcher methods * erase logs based on current package version Old implementation has used process id instead, but it leads to log removal in case of remote process trigger * add --server flag for setup command * restore behavior of the httploghandler
31 lines
1.2 KiB
Python
31 lines
1.2 KiB
Python
from ahriman.models.report_settings import ReportSettings
|
|
|
|
|
|
def test_from_option_invalid() -> None:
|
|
"""
|
|
must return disabled on invalid option
|
|
"""
|
|
assert ReportSettings.from_option("invalid") == ReportSettings.Disabled
|
|
|
|
|
|
def test_from_option_valid() -> None:
|
|
"""
|
|
must return value from valid options
|
|
"""
|
|
assert ReportSettings.from_option("html") == ReportSettings.HTML
|
|
assert ReportSettings.from_option("HTML") == ReportSettings.HTML
|
|
|
|
assert ReportSettings.from_option("email") == ReportSettings.Email
|
|
assert ReportSettings.from_option("EmAil") == ReportSettings.Email
|
|
|
|
assert ReportSettings.from_option("console") == ReportSettings.Console
|
|
assert ReportSettings.from_option("conSOle") == ReportSettings.Console
|
|
|
|
assert ReportSettings.from_option("telegram") == ReportSettings.Telegram
|
|
assert ReportSettings.from_option("TElegraM") == ReportSettings.Telegram
|
|
|
|
assert ReportSettings.from_option("remote-call") == ReportSettings.RemoteCall
|
|
assert ReportSettings.from_option("reMOte-cALL") == ReportSettings.RemoteCall
|
|
assert ReportSettings.from_option("ahriman") == ReportSettings.RemoteCall
|
|
assert ReportSettings.from_option("AhRiMAN") == ReportSettings.RemoteCall
|