def test_handle_result(container_factory, rabbit_manager, rabbit_config):
    container = container_factory(ExampleService, rabbit_config)
    container.start()

    with ServiceRpcProxy('exampleservice', rabbit_config) as proxy:

        assert proxy.echo("hello") == "hello"

        with pytest.raises(RemoteError) as exc:
            proxy.unserializable()
        assert "is not JSON serializable" in str(exc.value)

    wait_for_worker_idle(container)

    # verify ResultCollector sees values returned from `handle_result`
    assert worker_result_called == [
        ("hello", None),
        ("something went wrong", (TypeError, ANY, ANY)),
    ]
Verify that `handle_result` can modify the return values of the worker,
dataset/ETHPy150Open onefinestay/nameko/test/test_handle_result.py/test_handle_result