code: def test_router_de_serialization(self):
      routes = [
          {
              "condition": "{{streams|length < 2}}",
              "output": "{{query}}",
              "output_type": str,
              "output_name": "query",
          },
          {
              "condition": "{{streams|length >= 2}}",
              "output": "{{streams}}",
              "output_type": List[int],
              "output_name": "streams",
          },
      ]
      router = ConditionalRouter(routes)
      router_dict = router.to_dict()
  
      # assert that the router dict is correct, with all keys and values being strings
      for route in router_dict["init_parameters"]["routes"]:
          for key in route.keys():
              assert isinstance(key, str)
              assert isinstance(route[key], str)
  
      new_router = ConditionalRouter.from_dict(router_dict)
      assert router.routes == new_router.routes
  
      # now use both routers with the same input
      kwargs = {"streams": [1, 2, 3], "query": "Haystack"}
      result1 = router.run(**kwargs)
      result2 = new_router.run(**kwargs)
  
      # check that the result is the same and correct
      assert result1 == result2 and result1 == {"streams": [1, 2, 3]}
  
imports: import copy
  from typing import List
  from unittest import mock
  import pytest
  from haystack.components.routers import ConditionalRouter
  from haystack.components.routers.conditional_router import NoRouteSelectedException
  from haystack.dataclasses import ChatMessage
label_desc: Use image node_id 14 for calling the TestRouter obj's underlying member method code with example usage: obj.test_router_de_serialization() without return types