-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed process action event updated mail log removed reschedule logic
- Loading branch information
spandan_mondal
committed
Dec 11, 2024
1 parent
cbcccc2
commit b52635b
Showing
15 changed files
with
45 additions
and
282 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 was deleted.
Oops, something went wrong.
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
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
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
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
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 |
---|---|---|
|
@@ -172,8 +172,7 @@ async def test_send_mail(self, mock_get_channel_config, mock_smtp): | |
mail_response_log = MailResponseLog(bot=pytest.mail_test_bot, | ||
sender_id="[email protected]", | ||
user="mail_channel_test_user_acc", | ||
subject="Test Subject", | ||
body="Test Body", | ||
uid=123 | ||
) | ||
mail_response_log.save() | ||
mail_response_log.save() | ||
|
@@ -210,8 +209,7 @@ async def test_send_mail_exception(self, mock_get_channel_config, mock_smtp): | |
mail_response_log = MailResponseLog(bot=pytest.mail_test_bot, | ||
sender_id="[email protected]", | ||
user="mail_channel_test_user_acc", | ||
subject="Test Subject", | ||
body="Test Body", | ||
uid=123 | ||
) | ||
mail_response_log.save() | ||
|
||
|
@@ -253,8 +251,7 @@ def test_process_mail(self, mock_get_channel_config): | |
mail_response_log = MailResponseLog(bot=pytest.mail_test_bot, | ||
sender_id="[email protected]", | ||
user="mail_channel_test_user_acc", | ||
subject="Test Subject", | ||
body="Test Body", | ||
uid=123 | ||
) | ||
mail_response_log.save() | ||
|
||
|
@@ -311,15 +308,14 @@ async def test_read_mails(self, mock_get_channel_config, | |
mock_mailbox_instance.login.return_value = mock_mailbox_instance | ||
mock_mailbox_instance.fetch.return_value = [mock_mail_message] | ||
|
||
mails, user, time_shift = MailProcessor.read_mails(bot_id) | ||
mails, user = MailProcessor.read_mails(bot_id) | ||
print(mails) | ||
assert len(mails) == 1 | ||
assert mails[0]["subject"] == "Test Subject" | ||
assert mails[0]["mail_id"] == "[email protected]" | ||
assert mails[0]["date"] == "2023-10-10" | ||
assert mails[0]["body"] == "Test Body" | ||
assert user == 'mail_channel_test_user_acc' | ||
assert time_shift == 1200 | ||
|
||
|
||
|
||
|
@@ -349,10 +345,9 @@ async def test_read_mails_no_messages(self, mock_get_channel_config, | |
mock_mailbox_instance.login.return_value = mock_mailbox_instance | ||
mock_mailbox_instance.fetch.return_value = [] | ||
|
||
mails, user, time_shift = MailProcessor.read_mails(bot_id) | ||
mails, user = MailProcessor.read_mails(bot_id) | ||
assert len(mails) == 0 | ||
assert user == 'mail_channel_test_user_acc' | ||
assert time_shift == 1200 | ||
|
||
mock_logout_imap.assert_called_once() | ||
|
||
|
@@ -369,8 +364,7 @@ async def test_process_messages(self, mock_process_messages_via_bot, mock_send_m | |
mail_response_log = MailResponseLog(bot=pytest.mail_test_bot, | ||
sender_id="[email protected]", | ||
user="mail_channel_test_user_acc", | ||
subject="Test Subject", | ||
body="Test Body", | ||
uid=123 | ||
) | ||
mail_response_log.save() | ||
|
||
|
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
Oops, something went wrong.