class_docstr: Unittests for towhee cmdline.
class_docstr_tok: ["Unittests","for","towhee","cmdline","."]
code: def test_init(self):
      pyrepo = "towhee/init-pyoperator"
      nnrepo = "towhee/init-nnoperator"
      repo_path = PUBLIC_PATH / "mock_operators"
      os.chdir(str(repo_path))
      args_init_pyop = argparse.Namespace(
          action="init",
          type="pyop",
          dir=str(repo_path / "init-pyoperator"),
          uri=pyrepo,
          local=True,
      )
      args_init_nnop = argparse.Namespace(
          action="init",
          type="nnop",
          dir=str(repo_path / "init-nnoperator"),
          uri=nnrepo,
          local=True,
      )
  
      InitCommand(args_init_pyop)()
      InitCommand(args_init_nnop)()
      self.assertTrue(
          (
              repo_path / "init-pyoperator" / "init_pyoperator.py"
          ).is_file()
      )
      self.assertTrue(
          (
              repo_path / "init-nnoperator" / "init_nnoperator.py"
          ).is_file()
      )
  
      shutil.rmtree(str(repo_path / "init-pyoperator"))
      shutil.rmtree(str(repo_path / "init-nnoperator"))
  
file_path: towhee/tests/unittests/command/test_cmdline.py
imports: import os
  import sys
  import json
  import shutil
  import time
  import unittest
  import argparse
  import requests
  import subprocess
  from pathlib import Path
  from towhee.command.initialize import InitCommand
  from towhee.serve.grpc.client import Client
  from towhee.utils.serializer import from_json
label_desc: Use image node_id 1 for calling the TestCmdline obj's underlying member method code with example usage: obj.test_init() without return types