class_docstr: Test RuntimePipeline in Pipeline
class_docstr_tok: ["Test","RuntimePipeline","in","Pipeline"]
code: def test_reduce(self):
      p_in = (
          pipe.input("x")
          .flat_map("x", "x", lambda x: x)
          .reduce("x", "x", sum)
          .output("x")
      )
      p = pipe.input("x").map("x", "x", p_in).output("x")
  
      res = p([2] * 10).to_list()
      self.assertEqual(res, [[20]])
  
      with self.assertRaises(RuntimeError):
          p = pipe.input("x").reduce("x", "x", p_in).output("x")
  
file_path: towhee/tests/unittests/runtime/test_dag_pipeline.py
imports: import unittest
  from towhee import pipe
label_desc: Use image node_id 13 for calling the TestDAGPipeline obj's underlying member method code with example usage: obj.test_reduce() without return types