Exemplo n.º 1
0
    def test_provide_request_api(self):
        """Including `pyramid_torque_engine.client` reifies the torque api at
          `request.torque`.
        """

        mock_config = Mock()
        mock_lookup = Mock()
        engine_client.includeme(mock_config, lookup=mock_lookup)
        mock_config.add_request_method.assert_called_with(
                engine_client.get_torque_api, 'torque', reify=True)
Exemplo n.º 2
0
    def test_default_settings(self):
        """Including `pyramid_torque_engine.client` should set up the
          default settings.
        """

        mock_config = Mock()
        mock_lookup = Mock()
        engine_client.includeme(mock_config, lookup=mock_lookup)
        settings = mock_config.get_settings.return_value
        for key, value in engine_client.DEFAULTS.items():
            settings.setdefault.assert_any_call(key, value)