1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-10 06:48:19 +02:00

flake8 fixes

This commit is contained in:
Pascal F 2023-11-25 06:37:16 +01:00
parent 1c7ddca6ca
commit d55b6d0c8a
No known key found for this signature in database
GPG key ID: 3C576B538F890866
7 changed files with 17 additions and 24 deletions

View file

@ -1,6 +1,5 @@
import gzip
import os.path
import sys
import copy
from unittest import mock
@ -423,7 +422,7 @@ class TestProcessEmail(EmailMessageTestCase):
msg = self.mailbox.process_incoming_message(message)
actual_email_object = msg.get_email_object()
# actual_email_object = msg.get_email_object()
self.assertTrue(msg.eml.name.endswith('.eml.gz'))

View file

@ -2,26 +2,25 @@ from unittest import mock
from django.core.management import call_command, CommandError
from django.test import TestCase
import django
class CommandsTestCase(TestCase):
def test_processincomingmessage_no_args(self):
"""Check that processincomingmessage works with no args"""
mailbox_name = None
# Mock handle so that the test doesn't hang waiting for input. Note that we are only testing
# the argument parsing here -- functionality should be tested elsewhere
with mock.patch('django_mailbox.management.commands.processincomingmessage.Command.handle') as handle:
# Don't care about the return value
handle.return_value = None
call_command('processincomingmessage')
args, kwargs = handle.call_args
# Make sure that we called with the right arguments
self.assertEqual(kwargs['mailbox_name'], mailbox_name)
def test_processincomingmessage_with_arg(self):
"""Check that processincomingmessage works with mailbox_name given"""
@ -29,7 +28,7 @@ class CommandsTestCase(TestCase):
with mock.patch('django_mailbox.management.commands.processincomingmessage.Command.handle') as handle:
handle.return_value = None
call_command('processincomingmessage', mailbox_name)
args, kwargs = handle.call_args

View file

@ -8,7 +8,7 @@ from django_mailbox.transports import ImapTransport, Pop3Transport
FAKE_UID_SEARCH_ANSWER = (
'OK',
[
b'18 19 20 21 22 23 24 25 26 27 28 29 ' +
b'18 19 20 21 22 23 24 25 26 27 28 29 ' +
b'30 31 32 33 34 35 36 37 38 39 40 41 42 43 44'
]
)