test: code cleanup
This commit is contained in:
parent
c9cf148b03
commit
a2350c4591
|
@ -4,7 +4,6 @@ from subprocess import check_call, check_output
|
||||||
import smtplib
|
import smtplib
|
||||||
|
|
||||||
from settings import *
|
from settings import *
|
||||||
from common import random_id
|
|
||||||
from test_mail import new_message, check_imap_received
|
from test_mail import new_message, check_imap_received
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
import pytest
|
import pytest
|
||||||
from pycarddav import carddav
|
from pycarddav import carddav
|
||||||
from time import sleep
|
|
||||||
|
|
||||||
from settings import *
|
from settings import *
|
||||||
from common import random_id
|
|
||||||
|
|
||||||
|
|
||||||
test_vcf = """
|
test_vcf = """
|
||||||
|
|
|
@ -132,41 +132,6 @@ def test_smtp_tls():
|
||||||
assert check_imap_received(subject)
|
assert check_imap_received(subject)
|
||||||
|
|
||||||
|
|
||||||
# FIXME
|
|
||||||
#def test_smtps_headers():
|
|
||||||
# """Email sent from an MUA has DKIM and TLS headers"""
|
|
||||||
# import smtplib
|
|
||||||
# import imaplib
|
|
||||||
#
|
|
||||||
# # Send a message to admin
|
|
||||||
# mail_address = "admin@" + TEST_DOMAIN
|
|
||||||
# msg, subject = new_message(TEST_ADDRESS, mail_address)
|
|
||||||
# s = smtplib.SMTP(TEST_DOMAIN, 587)
|
|
||||||
# s.starttls()
|
|
||||||
# s.login(TEST_ADDRESS, TEST_PASSWORD)
|
|
||||||
# s.sendmail(TEST_ADDRESS, [mail_address], msg)
|
|
||||||
# s.quit()
|
|
||||||
#
|
|
||||||
# sleep(3)
|
|
||||||
#
|
|
||||||
# # Get the message
|
|
||||||
# m = imaplib.IMAP4_SSL(TEST_DOMAIN, 993)
|
|
||||||
# m.login(TEST_ADDRESS, TEST_PASSWORD)
|
|
||||||
# m.select()
|
|
||||||
# _, res = m.search(None, '(SUBJECT \"{}\")'.format(subject))
|
|
||||||
# _, data = m.fetch(res[0], '(RFC822)')
|
|
||||||
#
|
|
||||||
# assert 'DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailinabox.lan;' in data[0][1]
|
|
||||||
#
|
|
||||||
# assert 'ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)' in data[0][1]
|
|
||||||
#
|
|
||||||
# # Clean up
|
|
||||||
# m.store(res[0].strip(), '+FLAGS', '\\Deleted')
|
|
||||||
# m.expunge()
|
|
||||||
# m.close()
|
|
||||||
# m.logout()
|
|
||||||
|
|
||||||
|
|
||||||
def test_smtp_headers():
|
def test_smtp_headers():
|
||||||
"""Email sent from an MTA via SMTP+TLS has TLS headers"""
|
"""Email sent from an MTA via SMTP+TLS has TLS headers"""
|
||||||
# Send a message to root
|
# Send a message to root
|
||||||
|
|
Loading…
Reference in New Issue