Added doc comments

This commit is contained in:
Adrià Casajús 2022-05-10 18:26:56 +02:00
parent 6c13f7de05
commit d2111d4768
No known key found for this signature in database
GPG Key ID: F0033226A5AFC9B9
2 changed files with 6 additions and 1 deletions

View File

@ -51,6 +51,11 @@ class ProviderComplaintOrigin(ABC):
def sanitize_addresses(
cls, rcpt_header: Optional[str], message: Message
) -> Optional[OriginalAddresses]:
"""
If the rcpt_header is not None, use it as the valid rcpt address, otherwise try to extract it from the To header
of the original message, since in the original message there can be more than one recipients.
There can only be one sender so that one can safely be extracted from the message headers.
"""
try:
if not rcpt_header:
rcpt_header = message[headers.TO]

View File

@ -1,5 +1,5 @@
[pytest]
addopts =
xaddopts =
--cov
--cov-config coverage.ini
--cov-report=html:htmlcov