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

make tox -e flake8 work

This commit is contained in:
Fleur Dragan 2022-08-16 15:16:25 -05:00
parent 40263b6670
commit b6b903c025
7 changed files with 17 additions and 23 deletions

View file

@ -5,17 +5,18 @@ 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
@ -29,7 +30,6 @@ class CommandsTestCase(TestCase):
# Thus we expect an empty tuple here
self.assertEqual(args, tuple())
def test_processincomingmessage_with_arg(self):
"""Check that processincomingmessage works with mailbox_name given"""
@ -37,7 +37,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
try: