Skip to content

Commit

Permalink
mq_sendmail_test.py: fix test when run with Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixSchwarz committed Aug 5, 2024
1 parent 20b5e06 commit 4b0a632
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/mq_sendmail_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: MIT

import email
import os
import re
import subprocess
import sys
Expand Down Expand Up @@ -134,7 +135,11 @@ def test_mq_sendmail_with_queueing(ctx):
assert msg.to_addrs == ('[email protected]',)
assert msg.msg_id is None # not added automatically
assert msg.retries == 0
assert msg.msg_bytes == rfc_msg.encode('utf-8')
assert msg.msg_bytes == _to_platform_bytes(rfc_msg)


def _to_platform_bytes(msg_str: str) -> bytes:
return msg_str.replace('\n', os.linesep).encode('utf-8')


def _mq_sendmail(cli_params, msg, *, ctx=None, config_path=None):
Expand Down

0 comments on commit 4b0a632

Please sign in to comment.