class_docstr: GRPCServer test
class_docstr_tok: ["GRPCServer","test"]
code: def test_pipeline(self):
      self.server = GRPCServer(
          api_service.build_service(
              (
                  pipe.input("nums")
                  .map("nums", "sum", sum)
                  .output("sum"),
                  "/sum",
              )
          )
      )
  
      self.server.start("localhost", 50001)
      client = Client("localhost", 50001)
      response = client("/sum", [1, 2, 3])
      content = from_json(response.content)
      self.assertEqual(content[0][0], 6)
      response = client("/sum/batch", [[1, 2, 3], [2, 3, 4], [4, 5, 6]])
      content = from_json(response.content)
      self.assertEqual(content[0][0][0], 6)
      self.assertEqual(content[1][0][0], 9)
      self.assertEqual(content[2][0][0], 15)
  
      async def run_async():
          async with AsyncClient("localhost", 50001) as aclient:
              response = await aclient("/sum", [1, 2, 3])
              content = from_json(response.content)
              self.assertEqual(content[0][0], 6)
  
      asyncio.run(run_async())
  
imports: import unittest
  import typing
  import asyncio
  from pydantic import BaseModel
  import numpy
  from towhee import api_service, pipe
  from towhee.serve.grpc.server import GRPCServer
  from towhee.serve.grpc.client import Client, AsyncClient
  from towhee.serve.io import JSON, NDARRAY, BYTES
  from towhee.utils.serializer import from_json
label_desc: Use image node_id 5 for calling the TestGRPC obj's underlying member method code with example usage: obj.test_pipeline() without return types