diff options
author | Roald de Vries <rdevries@thoughtworks.com> | 2016-11-30 10:01:20 +0100 |
---|---|---|
committer | Roald de Vries <rdevries@thoughtworks.com> | 2016-11-30 10:01:20 +0100 |
commit | 54600b0454809eeed12b01960a1d0ecaeb0d86a9 (patch) | |
tree | 9d9a8af89dc66280d5474fa4ea9347a181cd05c9 | |
parent | b785705033d70725eb979f54bb3c248c82d648af (diff) |
mock out usage of ZMQ in the right place
-rw-r--r-- | service/test/unit/resources/test_root_resource.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/service/test/unit/resources/test_root_resource.py b/service/test/unit/resources/test_root_resource.py index 0db3bdbe..443a00e6 100644 --- a/service/test/unit/resources/test_root_resource.py +++ b/service/test/unit/resources/test_root_resource.py @@ -54,7 +54,7 @@ class TestRootResource(unittest.TestCase): child_resource = getChildForRequest(self.root_resource, request) self.assertIsInstance(child_resource, InboxResource) - @patch('pixelated.config.sessions.register') + @patch('pixelated.resources.mails_resource.events.register') def test_login_url_should_delegate_to_login_resource(self, *mocks): self.root_resource.initialize(provider=mock(), authenticator=mock()) request = DummyRequest(['login']) @@ -105,7 +105,7 @@ class TestRootResource(unittest.TestCase): request.requestHeaders.setRawHeaders('x-requested-with', ['XMLHttpRequest']) request.requestHeaders.setRawHeaders('x-xsrf-token', [csrf_token]) - @patch('pixelated.config.sessions.register') + @patch('pixelated.resources.mails_resource.events.register') def test_should_unauthorize_child_resource_ajax_requests_when_csrf_mismatch(self, *mocks): self.root_resource.initialize(provider=mock(), authenticator=mock()) @@ -138,7 +138,7 @@ class TestRootResource(unittest.TestCase): d.addCallback(assert_unavailable) return d - @patch('pixelated.config.sessions.register') + @patch('pixelated.resources.mails_resource.events.register') def test_GET_should_return_404_for_non_existing_resource(self, *mocks): self.root_resource.initialize(provider=mock(), authenticator=mock()) @@ -154,7 +154,7 @@ class TestRootResource(unittest.TestCase): d.addCallback(assert_not_found) return d - @patch('pixelated.config.sessions.register') + @patch('pixelated.resources.mails_resource.events.register') def test_should_404_non_existing_resource_with_valid_csrf(self, *mocks): self.root_resource.initialize(provider=mock(), authenticator=mock()) @@ -187,7 +187,7 @@ class TestRootResource(unittest.TestCase): d.addCallback(assert_unauthorized) return d - @patch('pixelated.config.sessions.register') + @patch('pixelated.resources.mails_resource.events.register') def test_should_unauthorize_child_resource_non_ajax_POST_requests_when_csrf_input_mismatch(self, *mocks): self.root_resource.initialize(provider=mock(), authenticator=mock()) @@ -209,7 +209,7 @@ class TestRootResource(unittest.TestCase): d.addCallback(assert_unauthorized) return d - @patch('pixelated.config.sessions.register') + @patch('pixelated.resources.mails_resource.events.register') def test_assets_should_be_publicly_available(self, *mocks): self.root_resource.initialize(provider=mock(), authenticator=mock()) @@ -222,7 +222,7 @@ class TestRootResource(unittest.TestCase): d.addCallback(assert_response) return d - @patch('pixelated.config.sessions.register') + @patch('pixelated.resources.mails_resource.events.register') def test_login_should_be_publicly_available(self, *mocks): self.root_resource.initialize(provider=mock(), authenticator=mock()) |