-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mq_sendmail_test.py
: fix test when run with Windows
- Loading branch information
1 parent
20b5e06
commit 4b0a632
Showing
1 changed file
with
6 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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): | ||
|