mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-30 06:09:56 +00:00
Email report (#11)
* Demo email report implementation * improved ssl mode * correct default option spelling and more fields to be hidden for not extended reports
This commit is contained in:
@ -18,3 +18,6 @@ def test_from_option_valid() -> None:
|
||||
"""
|
||||
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
|
||||
|
21
tests/ahriman/models/test_smtp_settings.py
Normal file
21
tests/ahriman/models/test_smtp_settings.py
Normal file
@ -0,0 +1,21 @@
|
||||
from ahriman.models.smtp_ssl_settings import SmtpSSLSettings
|
||||
|
||||
|
||||
def test_from_option_invalid() -> None:
|
||||
"""
|
||||
must return disabled value on invalid option
|
||||
"""
|
||||
assert SmtpSSLSettings.from_option("invalid") == SmtpSSLSettings.Disabled
|
||||
|
||||
|
||||
def test_from_option_valid() -> None:
|
||||
"""
|
||||
must return value from valid options
|
||||
"""
|
||||
assert SmtpSSLSettings.from_option("ssl") == SmtpSSLSettings.SSL
|
||||
assert SmtpSSLSettings.from_option("SSL") == SmtpSSLSettings.SSL
|
||||
assert SmtpSSLSettings.from_option("ssl/tls") == SmtpSSLSettings.SSL
|
||||
assert SmtpSSLSettings.from_option("SSL/TLS") == SmtpSSLSettings.SSL
|
||||
|
||||
assert SmtpSSLSettings.from_option("starttls") == SmtpSSLSettings.STARTTLS
|
||||
assert SmtpSSLSettings.from_option("STARTTLS") == SmtpSSLSettings.STARTTLS
|
Reference in New Issue
Block a user