diff options
author | Bruno Wagner <bwagner@riseup.net> | 2017-01-03 17:46:55 -0200 |
---|---|---|
committer | Bruno Wagner <bwagner@riseup.net> | 2017-01-03 17:46:55 -0200 |
commit | 391d2ff36f837ec293f4772efd7f6d64083004cd (patch) | |
tree | 1de0f5320dd2171f0cb73ae0a3c31d17fff72872 /service/test | |
parent | a342defed365690f2189eb209be8224a505b58e5 (diff) |
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.
Diffstat (limited to 'service/test')
-rw-r--r-- | service/test/unit/config/test_site.py | 5 |
1 files changed, 3 insertions, 2 deletions
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" |