Exemplo n.º 1
0
 def test_transform_request_headers(self):
     plugin = BasePlugin()
     pyramid_request = mock.Mock()
     assert plugin.transform_request_headers({'foo': 'bar'},
                                             pyramid_request) == {
                                                 'foo': 'bar'
                                             }
Exemplo n.º 2
0
 def test_after_response(self):
     plugin = BasePlugin()
     current_response = mock.sentinel.current_response
     original_response = mock.sentinel.original_response
     assert plugin.after_response(
         current_response,
         original_response,
     ) == current_response
Exemplo n.º 3
0
 def test_prepare_request(self):
     plugin = BasePlugin()
     current_jobs = mock.sentinel.current_jobs
     original_jobs = mock.sentinel.original_jobs
     assert plugin.prepare_request(
         current_jobs,
         original_jobs,
     ) == current_jobs
Exemplo n.º 4
0
 def test_should_send_request(self):
     plugin = BasePlugin()
     jobs = mock.sentinel.jobs
     assert plugin.should_send_request(jobs)
Exemplo n.º 5
0
 def test_get_view_data(self):
     plugin = BasePlugin()
     data = mock.sentinel.data
     assert plugin.get_view_data('MyComponent.js', data) == data