Skip to content

Commit

Permalink
Fix import.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémy HUBSCHER committed Apr 14, 2017
1 parent cc34a5d commit 47e7d32
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions kinto_emailer/tests/test_command_send.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import mock
import unittest

from kinto_emailer import send_email
from kinto_emailer import command_send


class CommandTest(unittest.TestCase):
def test_uses_sys_args_by_default(self):
assert send_email.main() > 0 # will fail
assert command_send.main() > 0 # will fail

def test_returns_non_zero_if_not_enough_args(self):
assert send_email.main([]) > 0
assert command_send.main([]) > 0

def test_calls_send_immmediately_with_parameters(self):
with mock.patch('kinto_emailer.send_email.bootstrap') as bootstrap:
with mock.patch('kinto_emailer.send_email.get_mailer') as get_mailer:
send_email.main(["config.ini", "me@restmail.net"])
with mock.patch('kinto_emailer.command_send.bootstrap'):
with mock.patch('kinto_emailer.command_send.get_mailer') as get_mailer:
command_send.main(["config.ini", "me@restmail.net"])

args, kwargs = get_mailer().send_immediately.call_args_list[0]
assert "kinto-emailer" in args[0].subject
Expand Down

0 comments on commit 47e7d32

Please sign in to comment.