code: def test_jtype(tmpdir):
      flow_path = os.path.join(tmpdir, "flow.yml")
  
      f = Flow()
      f.save_config(flow_path)
      with open(flow_path, "r", encoding="utf-8") as file:
          conf = yaml.safe_load(file)
          assert "jtype" in conf
          assert conf["jtype"] == "Flow"
      assert type(Flow.load_config(flow_path)) == Flow
  
      exec_path = os.path.join(tmpdir, "exec.yml")
  
      e = BaseExecutor()
      e.save_config(exec_path)
      with open(exec_path, "r", encoding="utf-8") as file:
          conf = yaml.safe_load(file)
          assert "jtype" in conf
          assert conf["jtype"] == "BaseExecutor"
  
      assert type(BaseExecutor.load_config(exec_path)) == BaseExecutor
  
      dep_path = os.path.join(tmpdir, "dep.yml")
  
      dep = Deployment(
          uses="YourExecutor", port=12345, replicas=3, shards=2
      )
      dep.save_config(dep_path)
      with open(dep_path, "r", encoding="utf-8") as file:
          conf = yaml.safe_load(file)
          assert "jtype" in conf
          assert conf["jtype"] == "Deployment"
          assert conf["with"]["shards"] == 2
          assert conf["with"]["replicas"] == 3
          assert conf["with"]["port"] == 12345
  
      loaded_deployment = Deployment.load_config(dep_path)
      assert type(loaded_deployment) == Deployment
      assert loaded_deployment.port == 12345
      assert loaded_deployment.args.shards == 2
      assert loaded_deployment.args.replicas == 3
  
imports: import dataclasses
  import os
  import pytest
  import yaml
  from jina import Deployment, Flow, requests
  from jina.constants import __default_executor__
  from jina.excepts import BadConfigSource
  from jina.jaml import JAML, JAMLCompatible
  from jina.serve.executors import BaseExecutor
label_desc: Use image node_id 8 for calling a global function with example usage: test_jtype(tmpdir) without return types