code: def test_mongo_server(self):
      # mock sqlquery
      with patch(
          "mindsdb.api.executor.command_executor.ExecuteCommands.execute_command"
      ) as mock_executor:
          # if this module was imported in other test it prevents mocking SQLQuery inside MongoServer thread
          # unload_module('mindsdb.api.mysql.mysql_proxy.executor.executor_commands')
  
          # start mongo server
          config = {
              "api": {
                  "mongodb": {
                      "host": "127.0.0.1",
                      "port": "47399",
                      "database": "mindsdb",
                  }
              },
          }
          # TODO run on own database
          fdi, cfg_file = tempfile.mkstemp(prefix="mindsdb_conf_")
  
          with os.fdopen(fdi, "w") as fd:
              json.dump(config, fd)
  
          os.environ["MINDSDB_CONFIG_PATH"] = cfg_file
  
          from mindsdb.api.mongo.server import MongoServer
  
          server = MongoServer(config)
          server_thread = threading.Thread(
              name="Mongo server",
              target=server.serve_forever,
          )
  
          # mongo client
          client_con = MongoClient(
              port=int(config["api"]["mongodb"]["port"])
          )
  
          try:
              server_thread.start()
  
              # TODO test create integration
  
              # run all methods with prefix t_
              for test_name, test_method in inspect.getmembers(
                  self, predicate=inspect.ismethod
              ):
                  if test_name.startswith("t_"):
                      mock_executor.reset_mock()
                      mock_executor.side_effect = (
                          lambda x: ExecuteAnswer(ANSWER_TYPE.OK)
                      )
  
                      test_method(client_con, mock_executor)
  
          except Exception as e:
              raise e
          finally:
              client_con.close()
  
              # shutdown server
              server.shutdown()
              server_thread.join()
              server.server_close()
  
imports: import datetime
  import json
  import threading
  import inspect
  from unittest.mock import patch
  import tempfile
  import os
  from pymongo import MongoClient
  from mindsdb_sql import parse_sql
  from mindsdb.api.executor.data_types.answer import ExecuteAnswer, ANSWER_TYPE
  from mindsdb.api.executor import Column
  from .executor_test_base import BaseUnitTest
label_desc: Use image node_id 1 for calling the TestMongoDBServer obj's underlying member method code with example usage: obj.test_mongo_server() without return types