mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-12-16 20:23:41 +00:00
also replace single quote to double one to confort PEP docstring + move _check_output to class properties to make it available for mocking
21 lines
567 B
Python
21 lines
567 B
Python
import pytest
|
|
|
|
from ahriman.core.exceptions import InvalidOption
|
|
from ahriman.models.report_settings import ReportSettings
|
|
|
|
|
|
def test_from_option_invalid() -> None:
|
|
"""
|
|
must raise exception on invalid option
|
|
"""
|
|
with pytest.raises(InvalidOption, match=".* `invalid`$"):
|
|
ReportSettings.from_option("invalid")
|
|
|
|
|
|
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
|