From 391d2ff36f837ec293f4772efd7f6d64083004cd Mon Sep 17 00:00:00 2001 From: Bruno Wagner Date: Tue, 3 Jan 2017 17:46:55 -0200 Subject: Fixed mockito conflict with zope I bumped into this problem where trial would try to clean up after running the SiteTest and run into an error 'RememberedInvocation has no attribute "_implied"' That happened because mockito is strict with the set of functions it's mock accepts and _implied doesn't exist. It didn't really make sense in this test context so I've adapted the test to use MagicMock instead and now the test pass without problems. --- service/test/unit/config/test_site.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'service/test/unit/config') diff --git a/service/test/unit/config/test_site.py b/service/test/unit/config/test_site.py index 6911b4a5..63ac9f1a 100644 --- a/service/test/unit/config/test_site.py +++ b/service/test/unit/config/test_site.py @@ -1,10 +1,11 @@ from twisted.trial import unittest -from mockito import mock +from mock import MagicMock from pixelated.config.site import PixelatedSite from twisted.protocols.basic import LineReceiver class TestPixelatedSite(unittest.TestCase): + def test_add_security_headers(self): request = self.create_request() request.process() @@ -36,7 +37,7 @@ class TestPixelatedSite(unittest.TestCase): def create_request(self): channel = LineReceiver() - channel.site = PixelatedSite(mock()) + channel.site = PixelatedSite(MagicMock()) request = PixelatedSite.requestFactory(channel=channel, queued=True) request.method = "GET" request.uri = "localhost" -- cgit v1.2.3