예제 #1
0
    def test_defaults_to_process_results(self, processor_mock):
        """Ensure _handle_results calls _process_results if not given."""
        from furious.processors import _handle_results

        _handle_results({})

        processor_mock.assert_called_once_with()
예제 #2
0
    def test_runs_given_function(self):
        """Ensure _handle_results calls the given results processor."""
        from furious.processors import _handle_results

        processor = Mock()

        _handle_results({'_process_results': processor})

        processor.assert_called_once_with()
예제 #3
0
    def test_runs_returned_async(self):
        """Ensure _handle_results runs Async returned by results processor."""
        from furious.async import Async
        from furious.processors import _handle_results

        processor = Mock()
        processor.return_value = Mock(spec=Async)

        _handle_results({'_process_results': processor})

        processor.return_value.start.assert_called_once_with()
예제 #4
0
    def test_starts_returned_context(self):
        """Ensure _handle_results starts Context returned by results processor.
        """
        from furious.context.context import Context
        from furious.processors import _handle_results

        processor = Mock()
        processor.return_value = Mock(spec=Context)

        _handle_results({'_process_results': processor})

        processor.return_value.start.assert_called_once_with()