Exemplo n.º 1
0
import traceback

from atp.api.comm_log import logger
from atp.engine.api_runner import add_memo, identify_errors, summary_remove_file_obj
from atp.engine.api_task_result_collector import save_testcase_reuse_record
from atp.httprunner import HttpRunner
from atp.engine.exceptions import RunCaseError, LoadCaseError
# from atp.engine.load_test_old import load_test
from atp.engine.api_load_test import ApiTestLoader
from atp.engine.api_report import perfect_summary, save_report, save_last_run
from atp.config.default import get_config
from atp.utils.custom import *
from atp.utils.tools import json_dumps, get_host
from atp.httprunner import logger as hr_logger

config = get_config()
run_case_log_dir = config.RUN_CASE_LOG_DIR


def api_run_test(**kwargs):
    report_id = kwargs.pop('report_id', None)
    plan_name = kwargs.pop('plan_name', None)
    project_id = kwargs.pop('project_id', None)
    testcase_main_id_list = kwargs.get('testcase_main_id_list', None)
    failfast = kwargs.pop('failfast', False)
    if testcase_main_id_list:
        is_main = True
    else:
        is_main = False

    try:
Exemplo n.º 2
0
import os, xmind, time
from xmind.core.const import TOPIC_DETACHED
from xmind.core.markerref import MarkerId
import json
import zipfile
from atp import app
from collections import OrderedDict
try:
    import xml.etree.cElementTree as ET
except ImportError:
    import xml.etree.ElementTree as ET

from atp.api.comm_log import logger
from atp.config.default import get_config

CONFIG = get_config()
basedir = os.path.abspath(os.path.join(os.getcwd(), ".."))


class XmindParser(object):
    def __init__(self, **kwargs):
        self.temp_dir = kwargs.pop('temp_dir', CONFIG.TEMP_DIR)
        self.target_xml_name = 'content.xml'
        self.xmind_file = kwargs.pop('xmind_file', None)
        self.xml_file = kwargs.pop('xml_file', None)
        self.xmlns = kwargs.pop('xmlns', '')

    def __del__(self):
        if self.xml_file:
            os.remove(self.xml_file)