+ {% with obj = function, html_id = function.path %}
+
+ {% if root %}
+ {% set show_full_path = config.show_root_full_path %}
+ {% set root_members = True %}
+ {% elif root_members %}
+ {% set show_full_path = config.show_root_members_full_path or config.show_object_full_path %}
+ {% set root_members = False %}
+ {% else %}
+ {% set show_full_path = config.show_object_full_path %}
+ {% endif %}
+
+ {% set function_name = function.path if show_full_path else function.name %}
+ {#- Brief or full function name depending on configuration. -#}
+ {% set symbol_type = "method" if function.parent.is_class else "function" %}
+ {#- Symbol type: method when parent is a class, function otherwise. -#}
+
+ {% if not root or config.show_root_heading %}
+ {% filter heading(
+ heading_level,
+ role="function",
+ id=html_id,
+ class="doc doc-heading",
+ toc_label=(('
')|safe if config.show_symbol_type_toc else '') + function.docstring.value.split("\n", 1)[0] if function.docstring.value.split("\n", 1)[0] else function.name,
+ ) %}
+
+ {% block heading scoped %}
+ {#- Heading block.
+
+ This block renders the heading for the function.
+ -#}
+ {% if config.show_symbol_type_heading %}
{% endif %}
+ {% if config.separate_signature %}
+
{{ config.heading if config.heading and root else function_name }}
+ {% else %}
+ {%+ filter highlight(language="python", inline=True) %}
+ {{ function_name }}{% include "signature"|get_template with context %}
+ {% endfilter %}
+ {% endif %}
+ {% endblock heading %}
+
+ {% block labels scoped %}
+ {#- Labels block.
+
+ This block renders the labels for the function.
+ -#}
+ {% with labels = function.labels %}
+ {% include "labels"|get_template with context %}
+ {% endwith %}
+ {% endblock labels %}
+
+ {% endfilter %}
+
+ {% block signature scoped %}
+ {#- Signature block.
+
+ This block renders the signature for the function,
+ as well as its overloaded signatures if any.
+ -#}
+ {% if function.overloads %}
+
+ {% for overload in function.overloads %}
+ {% filter format_signature(overload, config.line_length, annotations=True, crossrefs=config.signature_crossrefs) %}
+ {{ overload.name }}
+ {% endfilter %}
+ {% endfor %}
+
+ {% endif %}
+ {% if config.separate_signature %}
+ {% filter format_signature(function, config.line_length, crossrefs=config.signature_crossrefs) %}
+ {{ function.name }}
+ {% endfilter %}
+ {% endif %}
+ {% endblock signature %}
+
+ {% else %}
+
+ {% if config.show_root_toc_entry %}
+ {% filter heading(
+ heading_level,
+ role="function",
+ id=html_id,
+ toc_label=(('
')|safe if config.show_symbol_type_toc else '') + (config.toc_label if config.toc_label and root else function.name),
+ hidden=True,
+ ) %}
+ {% endfilter %}
+ {% endif %}
+ {% set heading_level = heading_level - 1 %}
+ {% endif %}
+
+
+ {% block contents scoped %}
+ {#- Contents block.
+
+ This block renders the contents of the function.
+ It contains other blocks that users can override.
+ Overriding the contents block allows to rearrange the order of the blocks.
+ -#}
+ {% block docstring scoped %}
+ {#- Docstring block.
+
+ This block renders the docstring for the function.
+ -#}
+ {% with docstring_sections = function.docstring.parsed %}
+ {% include "docstring"|get_template with context %}
+ {% endwith %}
+ {% endblock docstring %}
+
+ {% block source scoped %}
+ {#- Source block.
+
+ This block renders the source code for the function.
+ -#}
+ {% if config.show_source and function.source %}
+
+ {{ lang.t("Source code in") }}
+ {%- if function.relative_filepath.is_absolute() -%}
+ {{ function.relative_package_filepath }}
+ {%- else -%}
+ {{ function.relative_filepath }}
+ {%- endif -%}
+
+ {{ function.source|highlight(language="python", linestart=function.lineno or 0, linenums=True) }}
+
+ {% endif %}
+ {% endblock source %}
+ {% endblock contents %}
+
+
+ {% endwith %}
+
diff --git a/tests/test_new/test.py b/tests/test_new/test.py
new file mode 100644
index 0000000000..ab1bdc21d3
--- /dev/null
+++ b/tests/test_new/test.py
@@ -0,0 +1,704 @@
+#!/usr/bin/python
+###################################################################
+# Copyright (c) 2016 by TAOS Technologies, Inc.
+# All rights reserved.
+#
+# This file is proprietary and confidential to TAOS Technologies.
+# No part of this file may be reproduced, stored, transmitted,
+# disclosed or used in any form or by any means other than as
+# expressly provided by the written permission from Jianhui Tao
+#
+###################################################################
+# install pip
+# pip install src/connector/python/
+
+# -*- coding: utf-8 -*-
+import os
+import sys
+import getopt
+import subprocess
+import time
+import base64
+import json
+import platform
+import socket
+import threading
+import importlib
+print(f"Python version: {sys.version}")
+print(f"Version info: {sys.version_info}")
+
+import toml
+sys.path.append("../pytest")
+from util.log import *
+from util.dnodes import *
+from util.cases import *
+from util.cluster import *
+from util.taosadapter import *
+
+import taos
+import taosrest
+import taosws
+
+def checkRunTimeError():
+ import win32gui
+ timeCount = 0
+ while 1:
+ time.sleep(1)
+ timeCount = timeCount + 1
+ print("checkRunTimeError",timeCount)
+ if (timeCount>1200):
+ print("stop the test.")
+ os.system("TASKKILL /F /IM taosd.exe")
+ os.system("TASKKILL /F /IM taos.exe")
+ os.system("TASKKILL /F /IM tmq_sim.exe")
+ os.system("TASKKILL /F /IM mintty.exe")
+ os.system("TASKKILL /F /IM python.exe")
+ quit(0)
+ hwnd = win32gui.FindWindow(None, "Microsoft Visual C++ Runtime Library")
+ if hwnd:
+ os.system("TASKKILL /F /IM taosd.exe")
+
+#
+# run case on previous cluster
+#
+def runOnPreviousCluster(host, config, fileName):
+ print("enter run on previeous")
+
+ # load case module
+ sep = "/"
+ if platform.system().lower() == 'windows':
+ sep = os.sep
+ moduleName = fileName.replace(".py", "").replace(sep, ".")
+ uModule = importlib.import_module(moduleName)
+ case = uModule.TDTestCase()
+
+ # create conn
+ conn = taos.connect(host, config)
+
+ # run case
+ case.init(conn, False)
+ try:
+ case.run()
+ except Exception as e:
+ tdLog.notice(repr(e))
+ tdLog.exit("%s failed" % (fileName))
+ # stop
+ case.stop()
+
+
+if __name__ == "__main__":
+
+ #
+ # analysis paramaters
+ #
+ fileName = "all"
+ deployPath = ""
+ masterIp = ""
+ testCluster = False
+ valgrind = 0
+ killValgrind = 1
+ logSql = True
+ stop = 0
+ restart = False
+ dnodeNums = 1
+ mnodeNums = 0
+ updateCfgDict = {}
+ adapter_cfg_dict = {}
+ execCmd = ""
+ queryPolicy = 1
+ createDnodeNums = 1
+ restful = False
+ websocket = False
+ replicaVar = 1
+ asan = False
+ independentMnode = False
+ previousCluster = False
+ crashGen = False
+ opts, args = getopt.gnu_getopt(sys.argv[1:], 'f:p:m:l:scghrd:k:e:N:M:Q:C:RWD:n:i:aP:G', [
+ 'file=', 'path=', 'master', 'logSql', 'stop', 'cluster', 'valgrind', 'help', 'restart', 'updateCfgDict', 'killv', 'execCmd','dnodeNums','mnodeNums','queryPolicy','createDnodeNums','restful','websocket','adaptercfgupdate','replicaVar','independentMnode','previous',"crashGen"])
+ for key, value in opts:
+ if key in ['-h', '--help']:
+ tdLog.printNoPrefix(
+ 'A collection of test cases written using Python')
+ tdLog.printNoPrefix('-f Name of test case file written by Python')
+ tdLog.printNoPrefix('-p Deploy Path for Simulator')
+ tdLog.printNoPrefix('-m Master Ip for Simulator')
+ tdLog.printNoPrefix('-l