code: def test_domain_connect_to_gateway_routes_priority() -> None:
      """
      A test for routes' priority (PythonNodeRoute)
      TODO: Add a similar test for HTTPNodeRoute
      """
      gateway_node_handle: NodeHandle = get_node_handle(
          NodeType.GATEWAY.value
      )
      gateway_client: GatewayClient = gateway_node_handle.login(
          email="info@openmined.org", password="changethis"
      )
      domain_client: DomainClient = get_admin_client(
          NodeType.DOMAIN.value
      )
  
      result = domain_client.connect_to_gateway(
          handle=gateway_node_handle
      )
      assert isinstance(result, SyftSuccess)
  
      all_peers = gateway_client.api.services.network.get_all_peers()
      assert len(all_peers) == 1
      domain_1_routes = all_peers[0].node_routes
      assert domain_1_routes[0].priority == 1
  
      # reconnect to the gateway. The route's priority should be increased by 1
      result = domain_client.connect_to_gateway(
          via_client=gateway_node_handle.client
      )
      assert isinstance(result, SyftSuccess)
      all_peers = gateway_client.api.services.network.get_all_peers()
      assert len(all_peers) == 1
      domain_1_routes = all_peers[0].node_routes
      assert domain_1_routes[0].priority == 2
  
      # another domain client connects to the gateway
      domain_client_2: DomainClient = get_admin_client(
          NodeType.DOMAIN.value
      )
      result = domain_client_2.connect_to_gateway(
          handle=gateway_node_handle
      )
      assert isinstance(result, SyftSuccess)
  
      all_peers = gateway_client.api.services.network.get_all_peers()
      assert len(all_peers) == 2
      for peer in all_peers:
          if peer.name == domain_client.metadata.name:
              assert peer.node_routes[0].priority == 2
          if peer.name == domain_client_2.metadata.name:
              assert peer.node_routes[0].priority == 1
  
file_path: PySyft/packages/syft/tests/syft/gateways/gateway_test.py
imports: from faker import Faker
  from hagrid.orchestra import NodeHandle
  import syft
  from syft.abstract_node import NodeType
  from syft.client.domain_client import DomainClient
  from syft.client.enclave_client import EnclaveClient
  from syft.client.gateway_client import GatewayClient
  from syft.service.network.node_peer import NodePeer
  from syft.service.response import SyftSuccess
  from syft.service.user.user_roles import ServiceRole
label_desc: Use image node_id 5 for calling a global function with example usage: test_domain_connect_to_gateway_routes_priority() without return types