forked from zulip/zulip
-
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.
Annotate zerver/tests/test_email_mirror.py.
- Loading branch information
1 parent
b741c73
commit f7092b1
Showing
2 changed files
with
10 additions
and
9 deletions.
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
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 |
---|---|---|
|
@@ -87,7 +87,7 @@ def test_receive_stream_email_messages_success(self): | |
|
||
stream_to_address = encode_email_address(stream) | ||
|
||
incoming_valid_message = MIMEText('TestStreamEmailMessages Body') | ||
incoming_valid_message = MIMEText('TestStreamEmailMessages Body') # type: Any # https://github.com/python/typeshed/issues/275 | ||
|
||
incoming_valid_message['Subject'] = 'TestStreamEmailMessages Subject' | ||
incoming_valid_message['From'] = "[email protected]" | ||
|
@@ -119,15 +119,15 @@ def test_receive_stream_email_messages_empty_body(self): | |
headers['Reply-To'] = '[email protected]' | ||
|
||
# empty body | ||
incoming_valid_message = MIMEText('') | ||
incoming_valid_message = MIMEText('') # type: Any # https://github.com/python/typeshed/issues/275 | ||
|
||
incoming_valid_message['Subject'] = 'TestStreamEmailMessages Subject' | ||
incoming_valid_message['From'] = "[email protected]" | ||
incoming_valid_message['To'] = stream_to_address | ||
incoming_valid_message['Reply-to'] = "[email protected]" | ||
|
||
exception_message = "" | ||
debug_info = {} | ||
debug_info = {} # type: Dict[str, Any] | ||
|
||
# process_message eats the exception & logs an error which can't be parsed here | ||
# so calling process_stream_message directly | ||
|
@@ -162,7 +162,7 @@ def test_receive_missed_personal_message_email_messages(self): | |
# token for looking up who did reply. | ||
mm_address = create_missed_message_address(user_profile, usermessage.message) | ||
|
||
incoming_valid_message = MIMEText('TestMissedMessageEmailMessages Body') | ||
incoming_valid_message = MIMEText('TestMissedMessageEmailMessages Body') # type: Any # https://github.com/python/typeshed/issues/275 | ||
|
||
incoming_valid_message['Subject'] = 'TestMissedMessageEmailMessages Subject' | ||
incoming_valid_message['From'] = "[email protected]" | ||
|
@@ -203,7 +203,7 @@ def test_receive_missed_huddle_message_email_messages(self): | |
# token for looking up who did reply. | ||
mm_address = create_missed_message_address(user_profile, usermessage.message) | ||
|
||
incoming_valid_message = MIMEText('TestMissedHuddleMessageEmailMessages Body') | ||
incoming_valid_message = MIMEText('TestMissedHuddleMessageEmailMessages Body') # type: Any # https://github.com/python/typeshed/issues/275 | ||
|
||
incoming_valid_message['Subject'] = 'TestMissedHuddleMessageEmailMessages Subject' | ||
incoming_valid_message['From'] = "[email protected]" | ||
|
@@ -250,6 +250,7 @@ class TestDigestEmailMessages(ZulipTestCase): | |
@mock.patch('zerver.lib.digest.enough_traffic') | ||
@mock.patch('zerver.lib.digest.send_future_email') | ||
def test_receive_digest_email_messages(self, mock_send_future_email, mock_enough_traffic): | ||
# type: (mock.MagicMock, mock.MagicMock) -> None | ||
|
||
# build dummy messages for missed messages email reply | ||
# have Hamlet send Othello a PM. Othello will reply via email | ||
|
@@ -262,7 +263,8 @@ def test_receive_digest_email_messages(self, mock_send_future_email, mock_enough | |
self.assert_json_success(result) | ||
|
||
user_profile = get_user_profile_by_email("[email protected]") | ||
cutoff = time.mktime(datetime.datetime(year=2016, month=1, day=1).timetuple()) | ||
cutoff = time.mktime(datetime.datetime(year=2016, month=1, day=1).timetuple()) # type: ignore # https://github.com/python/typeshed/pull/597 | ||
|
||
handle_digest_email(user_profile.id, cutoff) | ||
self.assertEqual(mock_send_future_email.call_count, 1) | ||
self.assertEqual(mock_send_future_email.call_args[0][0][0]['email'], | ||
|
@@ -286,7 +288,7 @@ def test_reply_is_extracted_from_plain(self): | |
Quote""" | ||
|
||
incoming_valid_message = MIMEText(text) | ||
incoming_valid_message = MIMEText(text) # type: Any # https://github.com/python/typeshed/issues/275 | ||
|
||
incoming_valid_message['Subject'] = 'TestStreamEmailMessages Subject' | ||
incoming_valid_message['From'] = "[email protected]" | ||
|
@@ -330,7 +332,7 @@ def test_reply_is_extracted_from_html(self): | |
</html> | ||
""" | ||
|
||
incoming_valid_message = MIMEText(html, 'html') | ||
incoming_valid_message = MIMEText(html, 'html') # type: Any # https://github.com/python/typeshed/issues/275 | ||
|
||
incoming_valid_message['Subject'] = 'TestStreamEmailMessages Subject' | ||
incoming_valid_message['From'] = "[email protected]" | ||
|