mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-27 16:57:18 +00:00
* migrate docstrings from reST to google format * add raises note Also change behaviour of the `from_option` method to fallback to disabled instead of raising exception on unknown option * fix part of warnings for sphinx * make identation a bit more readable * review fixes * add verbose description for properties to make them parsed by sphinx extenstion * add demo sphinx generator
26 lines
919 B
Python
26 lines
919 B
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
|