Skip to content

Commit

Permalink
poke around CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Reimirno committed Nov 20, 2023
1 parent 8dfdbbc commit ee07515
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions tests/unit/test_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def handle_message(self, message):

@pytest.fixture()
def smtp_server():
controller = Controller(CustomMessageHandler(), hostname='localhost', port=1025)
controller = Controller(CustomMessageHandler(), hostname='127.0.0.1', port=1025)
thread = threading.Thread(target=controller.start)
thread.start()

Expand All @@ -97,31 +97,6 @@ def smtp_server():
def test_send_plain_text_email_with_mock_smtp_server(smtp_server):
smtp_config = SMTPConfig(smtp_server.hostname, smtp_server.port, "user", "pass")

try:
success = send_email(
smtp=smtp_config,
from_addr=TEST_FROM_EMAIL,
to_addr=TEST_TO_EMAIL,
subject=TEST_SUBJECT,
body=TEST_BODY)

# assert success
except Exception as e:
print(e)

# msg = CustomMessageHandler.received_message
# CustomMessageHandler.received_message = None

# assert msg is not None
# assert msg['From'] == TEST_FROM_EMAIL
# assert msg['To'] == TEST_TO_EMAIL
# assert msg['Subject'] == TEST_SUBJECT
# assert TEST_BODY in msg.get_payload()


def test_send_plain_text_email_with_mock_smtp_server_2(smtp_server):
smtp_config = SMTPConfig(smtp_server.hostname, smtp_server.port, "user", "pass")

success = send_email(
smtp=smtp_config,
from_addr=TEST_FROM_EMAIL,
Expand Down

0 comments on commit ee07515

Please sign in to comment.