diff --git a/test/components/converters/test_output_adapter.py b/test/components/converters/test_output_adapter.py index 2fe57e301..25b5eb7e0 100644 --- a/test/components/converters/test_output_adapter.py +++ b/test/components/converters/test_output_adapter.py @@ -1,6 +1,8 @@ # SPDX-FileCopyrightText: 2022-present deepset GmbH # # SPDX-License-Identifier: Apache-2.0 + +from typing import List import json import pytest @@ -129,6 +131,17 @@ class TestOutputAdapter: # invoke the custom filter to check if it is deserialized correctly assert deserialized_adapter.custom_filters["custom_filter"]("test") == "TEST" + def test_sede_with_list_output_type_in_pipeline(self): + pipe = Pipeline() + pipe.add_component("adapter", OutputAdapter(template="{{ test }}", output_type=List[str])) + serialized_pipe = pipe.dumps() + + # we serialize the pipeline and check if the output type is serialized correctly (as typing.List[str]) + assert "typing.List[str]" in serialized_pipe + + deserialized_pipe = Pipeline.loads(serialized_pipe) + assert deserialized_pipe.get_component("adapter").output_type == List[str] + def test_output_adapter_from_dict_custom_filters_none(self): component = OutputAdapter.from_dict( data={