<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="CopilotDiffPersistence">
    <option name="pendingDiffs">
      <map>
        <entry key="$PROJECT_DIR$/conftest.py">
          <value>
            <PendingDiffInfo>
              <option name="filePath" value="$PROJECT_DIR$/conftest.py" />
              <option name="updatedContent" value="import os&#10;&#10;def pytest_sessionfinish(session, exitstatus):&#10;    # pytest 结束后自动生成 allure 报告&#10;    os.system(&quot;allure generate 测试报告 -o 测试报告/html --clean&quot;)&#10;" />
            </PendingDiffInfo>
          </value>
        </entry>
        <entry key="$PROJECT_DIR$/demo/main/test_a.py">
          <value>
            <PendingDiffInfo>
              <option name="filePath" value="$PROJECT_DIR$/demo/main/test_a.py" />
              <option name="originalContent" value="import pytest,json&#10;import jsonpath&#10;from demo.utils import get_excel as gexcel&#10;from demo.utils.send import ApiClient&#10;from demo.utils.write_log import write_log&#10;from demo.dic.global_value import GlobalInfo&#10;client = ApiClient()&#10;&#10;@pytest.mark.parametrize(&quot;case_info&quot;, gexcel.get_excel(&quot;demo&quot;, 0))&#10;def test_case(case_info):&#10;    #初始化全局变量&#10;    dic = GlobalInfo().show_info()&#10;&#10;    # 拼接请求参数&#10;    url = case_info[&quot;url&quot;]&#10;    method = case_info[&quot;method&quot;]&#10;    headers = eval(case_info[&quot;headers&quot;]) if case_info[&quot;headers&quot;] else {}&#10;    params = eval(case_info[&quot;params&quot;]) if case_info[&quot;params&quot;] else {}&#10;    data = eval(case_info[&quot;data&quot;]) if case_info[&quot;data&quot;] else {}&#10;    _json = eval(case_info[&quot;json&quot;]) if case_info[&quot;json&quot;] else {}&#10;&#10;    # 写日志&#10;    write_log(&quot;url&quot;,url)&#10;    write_log(&quot;headers&quot;,headers)&#10;    write_log(&quot;params&quot;,params)&#10;    write_log(&quot;data&quot;,data)&#10;&#10;    # 前置操作&#10;&#10;&#10;    res = client.send_request(method, url, headers=headers, params=params, data=data, json=_json)&#10;    write_log(&quot;respose&quot;, res.json())&#10;&#10;&#10;    # assert res.status_code == 200&#10;&#10;&#10;    # 后置操作&#10;    ## 提取变量&#10;    if case_info[&quot;提取变量&quot;] != &quot;&quot;:&#10;        vars_to_extract = [v.strip() for v in case_info[&quot;提取变量&quot;].split(&quot;,&quot;) if v.strip()]&#10;        for var in vars_to_extract:&#10;            value = jsonpath.jsonpath(res.json(), f&quot;$..{var}&quot;)&#10;            if value:&#10;                GlobalInfo().set_info(var, value[0])&#10;        write_log(&quot;globalInfo.txt&quot;, json.dumps(GlobalInfo().show_info()))&#10;&#10;    print(_json)" />
              <option name="updatedContent" value="import pytest, json&#10;import jsonpath&#10;from demo.utils import get_excel as gexcel&#10;from demo.utils.send import ApiClient&#10;from demo.utils.write_log import write_log&#10;from demo.dic.global_value import GlobalInfo&#10;client = ApiClient()&#10;&#10;@pytest.mark.parametrize(&quot;case_info&quot;, gexcel.get_excel(&quot;demo&quot;, 0))&#10;def test_case(case_info):&#10;    #初始化全局变量&#10;    dic = GlobalInfo().show_info()&#10;&#10;    # 拼接请求参数&#10;    url = case_info[&quot;url&quot;]&#10;    method = case_info[&quot;method&quot;]&#10;    headers = eval(case_info[&quot;headers&quot;]) if case_info[&quot;headers&quot;] else {}&#10;    params = eval(case_info[&quot;params&quot;]) if case_info[&quot;params&quot;] else {}&#10;    data = eval(case_info[&quot;data&quot;]) if case_info[&quot;data&quot;] else {}&#10;    _json = eval(case_info[&quot;json&quot;]) if case_info[&quot;json&quot;] else {}&#10;&#10;    # 写日志&#10;    write_log(&quot;url&quot;,url)&#10;    write_log(&quot;headers&quot;,headers)&#10;    write_log(&quot;params&quot;,params)&#10;    write_log(&quot;data&quot;,data)&#10;&#10;    # 前置操作&#10;&#10;&#10;    res = client.send_request(method, url, headers=headers, params=params, data=data, json=_json)&#10;    write_log(&quot;respose&quot;, res.json())&#10;&#10;&#10;    # assert res.status_code == 200&#10;&#10;&#10;    # 后置操作&#10;    ## 提取变量&#10;    if case_info[&quot;提取变量&quot;] != &quot;&quot;:&#10;        vars_to_extract = [v.strip() for v in case_info[&quot;提取变量&quot;].split(&quot;,&quot;) if v.strip()]&#10;        for var in vars_to_extract:&#10;            value = jsonpath.jsonpath(res.json(), f&quot;$..{var}&quot;)&#10;            if value:&#10;                GlobalInfo().set_info(var, value[0])&#10;        write_log(&quot;globalInfo.txt&quot;, json.dumps(GlobalInfo().show_info()))&#10;&#10;    print(_json)" />
            </PendingDiffInfo>
          </value>
        </entry>
        <entry key="$PROJECT_DIR$/demo/utils/get_excel.py">
          <value>
            <PendingDiffInfo>
              <option name="filePath" value="$PROJECT_DIR$/demo/utils/get_excel.py" />
              <option name="originalContent" value="import pandas as pd&#10;from pathlib import Path&#10;from . import write_log as log&#10;def get_excel(file_name, sheet_name=0):&#10;    &quot;&quot;&quot;&#10;    读取excel文件目录下.xlsx文件内容到DataFrame，并用空字符串填充缺失值&#10;    :param file_name:&#10;    :param sheet_name: 工作表名称或索引，默认读取第一个工作表&#10;    :return: 填充缺失值后的DataFrame&#10;    &quot;&quot;&quot;&#10;&#10;&#10;    project_root = Path(__file__).parent.parent&#10;    # 拼接 demo/demo.xlsx 路径&#10;    file_path = project_root / &quot;excel&quot; / (file_name+&quot;.xlsx&quot;)&#10;&#10;    df = pd.read_excel(file_path, sheet_name=sheet_name)&#10;    df = df.fillna(&quot;&quot;)  # 用空字符串填充缺失值&#10;    df = df.to_dict(orient=&quot;records&quot;)&#10;    # print(df)&#10;&#10;    log.clear_log(file_name)&#10;    log.write_log(file_name, df)&#10;    return df&#10;&#10;# print(file_path)" />
              <option name="updatedContent" value="import pandas as pd&#10;from pathlib import Path&#10;from . import write_log as log&#10;def get_excel(file_name, sheet_name=0):&#10;    &quot;&quot;&quot;&#10;    读取excel文件目录下.xlsx文件内容到DataFrame，并用空字符串填充缺失值&#10;    :param file_name:&#10;    :param sheet_name: 工作表名称或索引，默认读取第一个工作表&#10;    :return: 填充缺失值后的DataFrame&#10;    &quot;&quot;&quot;&#10;&#10;&#10;    project_root = Path(__file__).parent.parent&#10;    # 拼接 demo/demo.xlsx 路径&#10;    file_path = project_root / &quot;excel&quot; / (file_name+&quot;.xlsx&quot;)&#10;&#10;    df = pd.read_excel(file_path, sheet_name=sheet_name)&#10;    df = df.fillna(&quot;&quot;)  # 用空字符串填充缺失值&#10;    df = df.to_dict(orient=&quot;records&quot;)&#10;    # print(df)&#10;&#10;    log.clear_log(file_name)&#10;    log.write_log(file_name, df)&#10;    return df&#10;&#10;# print(file_path)" />
            </PendingDiffInfo>
          </value>
        </entry>
      </map>
    </option>
  </component>
</project>