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
23 lines
752 B
Python
23 lines
752 B
Python
from ahriman.models.upload_settings import UploadSettings
|
|
|
|
|
|
def test_from_option_invalid() -> None:
|
|
"""
|
|
must return disabled on invalid option
|
|
"""
|
|
assert UploadSettings.from_option("invalid") == UploadSettings.Disabled
|
|
|
|
|
|
def test_from_option_valid() -> None:
|
|
"""
|
|
must return value from valid options
|
|
"""
|
|
assert UploadSettings.from_option("rsync") == UploadSettings.Rsync
|
|
assert UploadSettings.from_option("RSYNC") == UploadSettings.Rsync
|
|
|
|
assert UploadSettings.from_option("s3") == UploadSettings.S3
|
|
assert UploadSettings.from_option("S3") == UploadSettings.S3
|
|
|
|
assert UploadSettings.from_option("github") == UploadSettings.Github
|
|
assert UploadSettings.from_option("GitHub") == UploadSettings.Github
|