From b97e47d564cc4bbd6b0f0ac2cccc0fa46490c764 Mon Sep 17 00:00:00 2001 From: Roald de Vries Date: Fri, 25 Nov 2016 15:53:53 +0100 Subject: don't mock the root resource in auth wrapper test --- service/test/unit/resources/test_auth.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'service/test/unit/resources/test_auth.py') diff --git a/service/test/unit/resources/test_auth.py b/service/test/unit/resources/test_auth.py index 05d07130..2b85a3cf 100644 --- a/service/test/unit/resources/test_auth.py +++ b/service/test/unit/resources/test_auth.py @@ -18,10 +18,11 @@ class TestPixelatedAuthSessionWrapper(unittest.TestCase): def setUp(self): self.portal_mock = mock() self.user_uuid_mock = mock() - self.root_resource_mock = mock() + services_factory = mock() + self.root_resource = RootResource(services_factory) self.anonymous_resource_mock = mock() - self.session_wrapper = PixelatedAuthSessionWrapper(self.portal_mock, self.root_resource_mock, self.anonymous_resource_mock) + self.session_wrapper = PixelatedAuthSessionWrapper(self.portal_mock, self.root_resource, self.anonymous_resource_mock) self.request = DummyRequest([]) self.request.prepath = [''] self.request.path = '/' @@ -45,7 +46,7 @@ class TestPixelatedAuthSessionWrapper(unittest.TestCase): d = deferred_resource.d def assert_root_resource(resource): - self.assertIs(resource, self.root_resource_mock) + self.assertIs(resource, self.root_resource) d.addCallback(assert_root_resource) return d -- cgit v1.2.3