Skip to content

Commit

Permalink
Merge branch 'add-ftps-sender' of github.com:liberation/django-carrie…
Browse files Browse the repository at this point in the history
…r-pigeon into add-ftps-sender
  • Loading branch information
Xavier Grangier committed Apr 2, 2014
2 parents 51c504f + 0b8e1bf commit 59f8473
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions carrier_pigeon/tests.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from mock import MagicMock
from mock import patch

from django.test import TestCase
from django.contrib.auth.models import User

from senders import FTPSSender
from configuration import DefaultConfiguration
from models import ItemToPush

Expand All @@ -18,12 +19,8 @@ def get_items_to_push(self):
class FTPSTestCase(TestCase):

def test_ftp_class(self):
def deliver(f, tu, r):
# mock the deliver method
return True

config = TestConfiguration()
config.deliver = MagicMock()
for item in config.get_items_to_push():
config.process_item(item.content_object, item)
config.deliver.assert_called_once()
with patch.object(FTPSSender, 'deliver', return_value=True) as mock_deliver:
config = TestConfiguration()
for item in config.get_items_to_push():
config.process_item(item.content_object, item)
mock_deliver.assert_called_once()

0 comments on commit 59f8473

Please sign in to comment.