From 6756d08e8f63bdce9ae642fff74ccb6a79ba3e12 Mon Sep 17 00:00:00 2001 From: Wu Clan Date: Sun, 11 Jun 2023 13:02:38 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A5=20=E9=87=8D=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=90=8D=E4=B8=BAhttpfpt=20(#12)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Rename the project to httpfpt * 修正错别字 --- .github/workflows/ci.yml | 2 +- .gitignore | 8 +++--- .ruff.toml | 10 +++---- README.md | 14 +++++++--- {fastpt => httpfpt}/__init__.py | 0 {fastpt => httpfpt}/cli.py | 14 +++++----- {fastpt => httpfpt}/common/__init__.py | 0 {fastpt => httpfpt}/common/env_handler.py | 2 +- {fastpt => httpfpt}/common/excel_handler.py | 2 +- {fastpt => httpfpt}/common/json_handler.py | 2 +- {fastpt => httpfpt}/common/log.py | 2 +- {fastpt => httpfpt}/common/send_request.py | 26 +++++++++---------- {fastpt => httpfpt}/common/toml_handler.py | 2 +- {fastpt => httpfpt}/common/variable_cache.py | 2 +- {fastpt => httpfpt}/common/yaml_handler.py | 4 +-- {fastpt => httpfpt}/conftest.py | 8 +++--- {fastpt => httpfpt}/core/__init__.py | 0 .../core/allure_env/environment.properties | 0 {fastpt => httpfpt}/core/auth.yaml | 0 {fastpt => httpfpt}/core/conf.toml | 0 {fastpt => httpfpt}/core/get_conf.py | 2 +- {fastpt => httpfpt}/core/path_conf.py | 0 {fastpt => httpfpt}/core/run_env/dev.env | 0 {fastpt => httpfpt}/core/run_env/pro.env | 0 {fastpt => httpfpt}/data/__init__.py | 0 {fastpt => httpfpt}/data/global_vars.yaml | 0 {fastpt => httpfpt}/data/hooks.py | 0 .../test_project/api_test_case_template.yaml | 0 .../yaml_data/test_project/only_skip.yml | 0 .../yaml_data/test_project/upload_file.yaml | 0 {fastpt => httpfpt}/db/__init__.py | 0 {fastpt => httpfpt}/db/mysql_db.py | 18 ++++++------- {fastpt => httpfpt}/db/redis_db.py | 4 +-- {fastpt => httpfpt}/enums/__init__.py | 0 .../enums/allure_severity_type.py | 0 {fastpt => httpfpt}/enums/assert_type.py | 0 {fastpt => httpfpt}/enums/request/__init__.py | 0 {fastpt => httpfpt}/enums/request/auth.py | 0 {fastpt => httpfpt}/enums/request/body.py | 0 {fastpt => httpfpt}/enums/request/engin.py | 0 {fastpt => httpfpt}/enums/request/method.py | 0 {fastpt => httpfpt}/enums/sql_type.py | 0 {fastpt => httpfpt}/enums/var_type.py | 0 {fastpt => httpfpt}/pytest.ini | 0 {fastpt => httpfpt}/run.py | 16 ++++++------ {fastpt => httpfpt}/schemas/__init__.py | 0 {fastpt => httpfpt}/schemas/case_data.py | 0 .../templates/email_report.html | 0 .../templates/yaml_case_data.yaml | 0 {fastpt => httpfpt}/test_case/__init__.py | 0 .../test_case/test_project/__init__.py | 0 .../test_case/test_project/test_api.py | 2 +- .../test_api_test_case_template.py | 10 +++---- .../test_case/test_project/test_only_skip.py | 10 +++---- .../test_project/test_upload_file.py | 10 +++---- {fastpt => httpfpt}/utils/__init__.py | 0 {fastpt => httpfpt}/utils/allure_control.py | 2 +- {fastpt => httpfpt}/utils/assert_control.py | 8 +++--- {fastpt => httpfpt}/utils/auth_plugins.py | 10 +++---- .../utils/case_auto_generator.py | 16 ++++++------ .../utils/data_manage/__init__.py | 0 .../utils/data_manage/apifox.py | 12 ++++----- .../utils/data_manage/base_format.py | 0 .../utils/data_manage/git_repo.py | 0 {fastpt => httpfpt}/utils/data_manage/har.py | 0 .../utils/data_manage/jmeter.py | 0 .../utils/data_manage/openapi.py | 14 +++++----- .../utils/data_manage/postman.py | 0 {fastpt => httpfpt}/utils/enum_control.py | 0 {fastpt => httpfpt}/utils/file_control.py | 4 +-- .../utils/relate_testcase_executor.py | 20 +++++++------- {fastpt => httpfpt}/utils/request/__init__.py | 0 .../utils/request/case_data_file_parse.py | 2 +- .../utils/request/hooks_executor.py | 6 ++--- .../utils/request/ids_extract.py | 0 .../utils/request/request_data_parse.py | 24 ++++++++--------- .../utils/request/vars_extractor.py | 12 ++++----- .../utils/send_report/__init__.py | 0 .../utils/send_report/ding_talk.py | 4 +-- .../utils/send_report/lark_talk.py | 4 +-- .../utils/send_report/send_email.py | 8 +++--- {fastpt => httpfpt}/utils/time_control.py | 0 82 files changed, 161 insertions(+), 155 deletions(-) rename {fastpt => httpfpt}/__init__.py (100%) rename {fastpt => httpfpt}/cli.py (94%) rename {fastpt => httpfpt}/common/__init__.py (100%) rename {fastpt => httpfpt}/common/env_handler.py (96%) rename {fastpt => httpfpt}/common/excel_handler.py (97%) rename {fastpt => httpfpt}/common/json_handler.py (97%) rename {fastpt => httpfpt}/common/log.py (97%) rename {fastpt => httpfpt}/common/send_request.py (95%) rename {fastpt => httpfpt}/common/toml_handler.py (97%) rename {fastpt => httpfpt}/common/variable_cache.py (98%) rename {fastpt => httpfpt}/common/yaml_handler.py (97%) rename {fastpt => httpfpt}/conftest.py (95%) rename {fastpt => httpfpt}/core/__init__.py (100%) rename {fastpt => httpfpt}/core/allure_env/environment.properties (100%) rename {fastpt => httpfpt}/core/auth.yaml (100%) rename {fastpt => httpfpt}/core/conf.toml (100%) rename {fastpt => httpfpt}/core/get_conf.py (98%) rename {fastpt => httpfpt}/core/path_conf.py (100%) rename {fastpt => httpfpt}/core/run_env/dev.env (100%) rename {fastpt => httpfpt}/core/run_env/pro.env (100%) rename {fastpt => httpfpt}/data/__init__.py (100%) rename {fastpt => httpfpt}/data/global_vars.yaml (100%) rename {fastpt => httpfpt}/data/hooks.py (100%) rename {fastpt => httpfpt}/data/test_data/yaml_data/test_project/api_test_case_template.yaml (100%) rename {fastpt => httpfpt}/data/test_data/yaml_data/test_project/only_skip.yml (100%) rename {fastpt => httpfpt}/data/test_data/yaml_data/test_project/upload_file.yaml (100%) rename {fastpt => httpfpt}/db/__init__.py (100%) rename {fastpt => httpfpt}/db/mysql_db.py (91%) rename {fastpt => httpfpt}/db/redis_db.py (97%) rename {fastpt => httpfpt}/enums/__init__.py (100%) rename {fastpt => httpfpt}/enums/allure_severity_type.py (100%) rename {fastpt => httpfpt}/enums/assert_type.py (100%) rename {fastpt => httpfpt}/enums/request/__init__.py (100%) rename {fastpt => httpfpt}/enums/request/auth.py (100%) rename {fastpt => httpfpt}/enums/request/body.py (100%) rename {fastpt => httpfpt}/enums/request/engin.py (100%) rename {fastpt => httpfpt}/enums/request/method.py (100%) rename {fastpt => httpfpt}/enums/sql_type.py (100%) rename {fastpt => httpfpt}/enums/var_type.py (100%) rename {fastpt => httpfpt}/pytest.ini (100%) rename {fastpt => httpfpt}/run.py (92%) rename {fastpt => httpfpt}/schemas/__init__.py (100%) rename {fastpt => httpfpt}/schemas/case_data.py (100%) rename {fastpt => httpfpt}/templates/email_report.html (100%) rename {fastpt => httpfpt}/templates/yaml_case_data.yaml (100%) rename {fastpt => httpfpt}/test_case/__init__.py (100%) rename {fastpt => httpfpt}/test_case/test_project/__init__.py (100%) rename {fastpt => httpfpt}/test_case/test_project/test_api.py (94%) rename {fastpt => httpfpt}/test_case/test_project/test_api_test_case_template.py (71%) rename {fastpt => httpfpt}/test_case/test_project/test_only_skip.py (69%) rename {fastpt => httpfpt}/test_case/test_project/test_upload_file.py (70%) rename {fastpt => httpfpt}/utils/__init__.py (100%) rename {fastpt => httpfpt}/utils/allure_control.py (96%) rename {fastpt => httpfpt}/utils/assert_control.py (98%) rename {fastpt => httpfpt}/utils/auth_plugins.py (87%) rename {fastpt => httpfpt}/utils/case_auto_generator.py (88%) rename {fastpt => httpfpt}/utils/data_manage/__init__.py (100%) rename {fastpt => httpfpt}/utils/data_manage/apifox.py (94%) rename {fastpt => httpfpt}/utils/data_manage/base_format.py (100%) rename {fastpt => httpfpt}/utils/data_manage/git_repo.py (100%) rename {fastpt => httpfpt}/utils/data_manage/har.py (100%) rename {fastpt => httpfpt}/utils/data_manage/jmeter.py (100%) rename {fastpt => httpfpt}/utils/data_manage/openapi.py (97%) rename {fastpt => httpfpt}/utils/data_manage/postman.py (100%) rename {fastpt => httpfpt}/utils/enum_control.py (100%) rename {fastpt => httpfpt}/utils/file_control.py (90%) rename {fastpt => httpfpt}/utils/relate_testcase_executor.py (94%) rename {fastpt => httpfpt}/utils/request/__init__.py (100%) rename {fastpt => httpfpt}/utils/request/case_data_file_parse.py (97%) rename {fastpt => httpfpt}/utils/request/hooks_executor.py (95%) rename {fastpt => httpfpt}/utils/request/ids_extract.py (100%) rename {fastpt => httpfpt}/utils/request/request_data_parse.py (97%) rename {fastpt => httpfpt}/utils/request/vars_extractor.py (93%) rename {fastpt => httpfpt}/utils/send_report/__init__.py (100%) rename {fastpt => httpfpt}/utils/send_report/ding_talk.py (95%) rename {fastpt => httpfpt}/utils/send_report/lark_talk.py (96%) rename {fastpt => httpfpt}/utils/send_report/send_email.py (92%) rename {fastpt => httpfpt}/utils/time_control.py (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0a088a..e144934 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: # - name: check GITHUB_REF matches package version # uses: samuelcolvin/check-python-version@v3.2 # with: - # version_file_path: fastpt/__init__.py + # version_file_path: httpfpt/__init__.py lint: runs-on: ubuntu-latest name: lint diff --git a/.gitignore b/.gitignore index 0ac779e..7c641be 100644 --- a/.gitignore +++ b/.gitignore @@ -71,14 +71,14 @@ dmypy.json .pyre/ # test report -fastpt/report/ -fastpt/log/ +httpfpt/report/ +httpfpt/log/ # idea .idea/ # online case data -fastpt/data/online/ +httpfpt/data/online/ # ruff -fastpt/.ruff_cache/ +httpfpt/.ruff_cache/ diff --git a/.ruff.toml b/.ruff.toml index 52c3658..6fd29cd 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -21,8 +21,8 @@ ignore = ["F401"] line-length = 120 format = "grouped" target-version = "py38" -cache-dir = "./fastpt/.ruff_cache" -extend-exclude = ["fastpt/conftest.py"] +cache-dir = "./httpfpt/.ruff_cache" +extend-exclude = ["httpfpt/conftest.py"] [flake8-pytest-style] mark-parentheses = false @@ -47,6 +47,6 @@ order-by-type = true mypy-init-return = true [per-file-ignores] -"fastpt/test_case/test_*.py" = ["ANN001", "ANN201"] -"fastpt/conftest.py" = ["ANN001", "ANN201"] -"fastpt/cli.py" = ["E402"] +"httpfpt/test_case/test_*.py" = ["ANN001", "ANN201"] +"httpfpt/conftest.py" = ["ANN001", "ANN201", "ANN202"] +"httpfpt/cli.py" = ["E402"] diff --git a/README.md b/README.md index f13dd88..a5b3863 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,13 @@ -# Automated Api Pytest +# HttpFpt 基于数据驱动的接口自动化测试框架 +Http: http 请求, + +F:fast, + +pt:pytest + ## 功能点 - 多项目分级,自由切换,互不干扰 @@ -20,14 +26,14 @@ ## 帮助 -有关更多详细信息,请参阅 [文档](https://wu-clan.github.io/automated_api_pytest_docs) - +有关更多详细信息,请参阅 [文档](https://wu-clan.github.io/httpfpt_docs) ## 贡献 -欢迎加入,如果你有好的想法,可以提 issue 或者 pr +欢迎加入,如果你有好的想法,可以提交 issues 或 pr 对于 PR: + 1. Fork 仓库 2. git clone 你的仓库 3. 创建虚拟环境 `python3 -m venv venv` diff --git a/fastpt/__init__.py b/httpfpt/__init__.py similarity index 100% rename from fastpt/__init__.py rename to httpfpt/__init__.py diff --git a/fastpt/cli.py b/httpfpt/cli.py similarity index 94% rename from fastpt/cli.py rename to httpfpt/cli.py index 7160ced..2d5e3d6 100644 --- a/fastpt/cli.py +++ b/httpfpt/cli.py @@ -9,13 +9,13 @@ sys.path.append('..') -from fastpt.common.yaml_handler import read_yaml -from fastpt.schemas.case_data import CaseData -from fastpt.utils.file_control import search_all_case_yaml_files -from fastpt.utils.case_auto_generator import auto_generate_test_cases -from fastpt.utils.data_manage.openapi import SwaggerParser -from fastpt.utils.data_manage.apifox import ApiFoxParser -from fastpt.utils.data_manage.git_repo import GitRepoPaser +from httpfpt.common.yaml_handler import read_yaml +from httpfpt.schemas.case_data import CaseData +from httpfpt.utils.file_control import search_all_case_yaml_files +from httpfpt.utils.case_auto_generator import auto_generate_test_cases +from httpfpt.utils.data_manage.openapi import SwaggerParser +from httpfpt.utils.data_manage.apifox import ApiFoxParser +from httpfpt.utils.data_manage.git_repo import GitRepoPaser app = typer.Typer(rich_markup_mode='rich') diff --git a/fastpt/common/__init__.py b/httpfpt/common/__init__.py similarity index 100% rename from fastpt/common/__init__.py rename to httpfpt/common/__init__.py diff --git a/fastpt/common/env_handler.py b/httpfpt/common/env_handler.py similarity index 96% rename from fastpt/common/env_handler.py rename to httpfpt/common/env_handler.py index b2f53dc..af0c371 100644 --- a/fastpt/common/env_handler.py +++ b/httpfpt/common/env_handler.py @@ -5,7 +5,7 @@ import dotenv -from fastpt.common.log import log +from httpfpt.common.log import log def get_env_dict(filepath: str) -> dict: diff --git a/fastpt/common/excel_handler.py b/httpfpt/common/excel_handler.py similarity index 97% rename from fastpt/common/excel_handler.py rename to httpfpt/common/excel_handler.py index 6757a1d..9fe616d 100644 --- a/fastpt/common/excel_handler.py +++ b/httpfpt/common/excel_handler.py @@ -5,7 +5,7 @@ import xlrd -from fastpt.common.log import log +from httpfpt.common.log import log def read_excel(filepath: str, *, filename: str, sheet: str = 'Sheet1') -> List[Dict[str, Optional[Any]]]: diff --git a/fastpt/common/json_handler.py b/httpfpt/common/json_handler.py similarity index 97% rename from fastpt/common/json_handler.py rename to httpfpt/common/json_handler.py index e426d17..60d61d2 100644 --- a/fastpt/common/json_handler.py +++ b/httpfpt/common/json_handler.py @@ -4,7 +4,7 @@ import os from typing import Optional, NoReturn, Any -from fastpt.common.log import log +from httpfpt.common.log import log def read_json_file(filepath: Optional[str] = None, *, filename: str, **kwargs) -> dict: diff --git a/fastpt/common/log.py b/httpfpt/common/log.py similarity index 97% rename from fastpt/common/log.py rename to httpfpt/common/log.py index cb9abd6..e537721 100644 --- a/fastpt/common/log.py +++ b/httpfpt/common/log.py @@ -8,7 +8,7 @@ from loguru import logger -from fastpt.core.path_conf import LOG_PATH +from httpfpt.core.path_conf import LOG_PATH if TYPE_CHECKING: import loguru diff --git a/fastpt/common/send_request.py b/httpfpt/common/send_request.py similarity index 95% rename from fastpt/common/send_request.py rename to httpfpt/common/send_request.py index 4c1816e..25d6cc4 100644 --- a/fastpt/common/send_request.py +++ b/httpfpt/common/send_request.py @@ -11,19 +11,19 @@ from httpx import Response as HttpxResponse from requests import Response as RequestsResponse -from fastpt.common.log import log -from fastpt.core import get_conf -from fastpt.db.mysql_db import MysqlDB -from fastpt.enums.request.body import BodyType -from fastpt.enums.request.engin import EnginType -from fastpt.utils.allure_control import allure_attach_file, allure_step -from fastpt.utils.assert_control import Asserter -from fastpt.utils.enum_control import get_enum_values -from fastpt.utils.relate_testcase_executor import exec_setup_testcase -from fastpt.utils.request.hooks_executor import HookExecutor -from fastpt.utils.request.request_data_parse import RequestDataParse -from fastpt.utils.request.vars_extractor import VarsExtractor -from fastpt.utils.time_control import get_current_time +from httpfpt.common.log import log +from httpfpt.core import get_conf +from httpfpt.db.mysql_db import MysqlDB +from httpfpt.enums.request.body import BodyType +from httpfpt.enums.request.engin import EnginType +from httpfpt.utils.allure_control import allure_attach_file, allure_step +from httpfpt.utils.assert_control import Asserter +from httpfpt.utils.enum_control import get_enum_values +from httpfpt.utils.relate_testcase_executor import exec_setup_testcase +from httpfpt.utils.request.hooks_executor import HookExecutor +from httpfpt.utils.request.request_data_parse import RequestDataParse +from httpfpt.utils.request.vars_extractor import VarsExtractor +from httpfpt.utils.time_control import get_current_time class SendRequests: diff --git a/fastpt/common/toml_handler.py b/httpfpt/common/toml_handler.py similarity index 97% rename from fastpt/common/toml_handler.py rename to httpfpt/common/toml_handler.py index b033a8b..fff6ad7 100644 --- a/fastpt/common/toml_handler.py +++ b/httpfpt/common/toml_handler.py @@ -4,7 +4,7 @@ import rtoml -from fastpt.common.log import log +from httpfpt.common.log import log def read_toml(filepath: str, filename: str, encoding: str = 'utf-8') -> dict: diff --git a/fastpt/common/variable_cache.py b/httpfpt/common/variable_cache.py similarity index 98% rename from fastpt/common/variable_cache.py rename to httpfpt/common/variable_cache.py index 6571a4e..931bd7b 100644 --- a/fastpt/common/variable_cache.py +++ b/httpfpt/common/variable_cache.py @@ -2,7 +2,7 @@ from cache3 import SafeCache -from fastpt.common.log import log +from httpfpt.common.log import log class VariableCache: diff --git a/fastpt/common/yaml_handler.py b/httpfpt/common/yaml_handler.py similarity index 97% rename from fastpt/common/yaml_handler.py rename to httpfpt/common/yaml_handler.py index 5e0af02..0cc004e 100644 --- a/fastpt/common/yaml_handler.py +++ b/httpfpt/common/yaml_handler.py @@ -7,8 +7,8 @@ import yaml -from fastpt.common.log import log -from fastpt.core.path_conf import YAML_DATA_PATH, YAML_REPORT_PATH, TEST_DATA_PATH +from httpfpt.common.log import log +from httpfpt.core.path_conf import YAML_DATA_PATH, YAML_REPORT_PATH, TEST_DATA_PATH def read_yaml( diff --git a/fastpt/conftest.py b/httpfpt/conftest.py similarity index 95% rename from fastpt/conftest.py rename to httpfpt/conftest.py index c5b5127..0012071 100644 --- a/fastpt/conftest.py +++ b/httpfpt/conftest.py @@ -7,10 +7,10 @@ from filelock import FileLock from py._xmlgen import html -from fastpt.common.log import log -from fastpt.common.variable_cache import VariableCache -from fastpt.common.yaml_handler import write_yaml_report -from fastpt.core.get_conf import TESTER_NAME, PROJECT_NAME, TEST_REPORT_TITLE +from httpfpt.common.log import log +from httpfpt.common.variable_cache import VariableCache +from httpfpt.common.yaml_handler import write_yaml_report +from httpfpt.core.get_conf import TESTER_NAME, PROJECT_NAME, TEST_REPORT_TITLE @pytest.fixture(scope='session', autouse=True) diff --git a/fastpt/core/__init__.py b/httpfpt/core/__init__.py similarity index 100% rename from fastpt/core/__init__.py rename to httpfpt/core/__init__.py diff --git a/fastpt/core/allure_env/environment.properties b/httpfpt/core/allure_env/environment.properties similarity index 100% rename from fastpt/core/allure_env/environment.properties rename to httpfpt/core/allure_env/environment.properties diff --git a/fastpt/core/auth.yaml b/httpfpt/core/auth.yaml similarity index 100% rename from fastpt/core/auth.yaml rename to httpfpt/core/auth.yaml diff --git a/fastpt/core/conf.toml b/httpfpt/core/conf.toml similarity index 100% rename from fastpt/core/conf.toml rename to httpfpt/core/conf.toml diff --git a/fastpt/core/get_conf.py b/httpfpt/core/get_conf.py similarity index 98% rename from fastpt/core/get_conf.py rename to httpfpt/core/get_conf.py index 4da230f..69d9dfb 100644 --- a/fastpt/core/get_conf.py +++ b/httpfpt/core/get_conf.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- from pathlib import Path -from fastpt.common.toml_handler import read_toml +from httpfpt.common.toml_handler import read_toml __config = read_toml(str(Path(__file__).resolve().parent), 'conf.toml') diff --git a/fastpt/core/path_conf.py b/httpfpt/core/path_conf.py similarity index 100% rename from fastpt/core/path_conf.py rename to httpfpt/core/path_conf.py diff --git a/fastpt/core/run_env/dev.env b/httpfpt/core/run_env/dev.env similarity index 100% rename from fastpt/core/run_env/dev.env rename to httpfpt/core/run_env/dev.env diff --git a/fastpt/core/run_env/pro.env b/httpfpt/core/run_env/pro.env similarity index 100% rename from fastpt/core/run_env/pro.env rename to httpfpt/core/run_env/pro.env diff --git a/fastpt/data/__init__.py b/httpfpt/data/__init__.py similarity index 100% rename from fastpt/data/__init__.py rename to httpfpt/data/__init__.py diff --git a/fastpt/data/global_vars.yaml b/httpfpt/data/global_vars.yaml similarity index 100% rename from fastpt/data/global_vars.yaml rename to httpfpt/data/global_vars.yaml diff --git a/fastpt/data/hooks.py b/httpfpt/data/hooks.py similarity index 100% rename from fastpt/data/hooks.py rename to httpfpt/data/hooks.py diff --git a/fastpt/data/test_data/yaml_data/test_project/api_test_case_template.yaml b/httpfpt/data/test_data/yaml_data/test_project/api_test_case_template.yaml similarity index 100% rename from fastpt/data/test_data/yaml_data/test_project/api_test_case_template.yaml rename to httpfpt/data/test_data/yaml_data/test_project/api_test_case_template.yaml diff --git a/fastpt/data/test_data/yaml_data/test_project/only_skip.yml b/httpfpt/data/test_data/yaml_data/test_project/only_skip.yml similarity index 100% rename from fastpt/data/test_data/yaml_data/test_project/only_skip.yml rename to httpfpt/data/test_data/yaml_data/test_project/only_skip.yml diff --git a/fastpt/data/test_data/yaml_data/test_project/upload_file.yaml b/httpfpt/data/test_data/yaml_data/test_project/upload_file.yaml similarity index 100% rename from fastpt/data/test_data/yaml_data/test_project/upload_file.yaml rename to httpfpt/data/test_data/yaml_data/test_project/upload_file.yaml diff --git a/fastpt/db/__init__.py b/httpfpt/db/__init__.py similarity index 100% rename from fastpt/db/__init__.py rename to httpfpt/db/__init__.py diff --git a/fastpt/db/mysql_db.py b/httpfpt/db/mysql_db.py similarity index 91% rename from fastpt/db/mysql_db.py rename to httpfpt/db/mysql_db.py index 14af91a..ab0aa59 100644 --- a/fastpt/db/mysql_db.py +++ b/httpfpt/db/mysql_db.py @@ -8,15 +8,15 @@ from dbutils.pooled_db import PooledDB from jsonpath import jsonpath -from fastpt.common.env_handler import write_env_vars -from fastpt.common.log import log -from fastpt.common.variable_cache import VariableCache -from fastpt.common.yaml_handler import write_yaml_vars -from fastpt.core import get_conf -from fastpt.core.path_conf import RUN_ENV_PATH -from fastpt.enums.sql_type import SqlType -from fastpt.enums.var_type import VarType -from fastpt.utils.enum_control import get_enum_values +from httpfpt.common.env_handler import write_env_vars +from httpfpt.common.log import log +from httpfpt.common.variable_cache import VariableCache +from httpfpt.common.yaml_handler import write_yaml_vars +from httpfpt.core import get_conf +from httpfpt.core.path_conf import RUN_ENV_PATH +from httpfpt.enums.sql_type import SqlType +from httpfpt.enums.var_type import VarType +from httpfpt.utils.enum_control import get_enum_values class MysqlDB: diff --git a/fastpt/db/redis_db.py b/httpfpt/db/redis_db.py similarity index 97% rename from fastpt/db/redis_db.py rename to httpfpt/db/redis_db.py index e4c259b..fa710da 100644 --- a/fastpt/db/redis_db.py +++ b/httpfpt/db/redis_db.py @@ -5,8 +5,8 @@ from redis import Redis, AuthenticationError -from fastpt.common.log import log -from fastpt.core import get_conf +from httpfpt.common.log import log +from httpfpt.core import get_conf class RedisDB: diff --git a/fastpt/enums/__init__.py b/httpfpt/enums/__init__.py similarity index 100% rename from fastpt/enums/__init__.py rename to httpfpt/enums/__init__.py diff --git a/fastpt/enums/allure_severity_type.py b/httpfpt/enums/allure_severity_type.py similarity index 100% rename from fastpt/enums/allure_severity_type.py rename to httpfpt/enums/allure_severity_type.py diff --git a/fastpt/enums/assert_type.py b/httpfpt/enums/assert_type.py similarity index 100% rename from fastpt/enums/assert_type.py rename to httpfpt/enums/assert_type.py diff --git a/fastpt/enums/request/__init__.py b/httpfpt/enums/request/__init__.py similarity index 100% rename from fastpt/enums/request/__init__.py rename to httpfpt/enums/request/__init__.py diff --git a/fastpt/enums/request/auth.py b/httpfpt/enums/request/auth.py similarity index 100% rename from fastpt/enums/request/auth.py rename to httpfpt/enums/request/auth.py diff --git a/fastpt/enums/request/body.py b/httpfpt/enums/request/body.py similarity index 100% rename from fastpt/enums/request/body.py rename to httpfpt/enums/request/body.py diff --git a/fastpt/enums/request/engin.py b/httpfpt/enums/request/engin.py similarity index 100% rename from fastpt/enums/request/engin.py rename to httpfpt/enums/request/engin.py diff --git a/fastpt/enums/request/method.py b/httpfpt/enums/request/method.py similarity index 100% rename from fastpt/enums/request/method.py rename to httpfpt/enums/request/method.py diff --git a/fastpt/enums/sql_type.py b/httpfpt/enums/sql_type.py similarity index 100% rename from fastpt/enums/sql_type.py rename to httpfpt/enums/sql_type.py diff --git a/fastpt/enums/var_type.py b/httpfpt/enums/var_type.py similarity index 100% rename from fastpt/enums/var_type.py rename to httpfpt/enums/var_type.py diff --git a/fastpt/pytest.ini b/httpfpt/pytest.ini similarity index 100% rename from fastpt/pytest.ini rename to httpfpt/pytest.ini diff --git a/fastpt/run.py b/httpfpt/run.py similarity index 92% rename from fastpt/run.py rename to httpfpt/run.py index 9282d47..4206071 100644 --- a/fastpt/run.py +++ b/httpfpt/run.py @@ -7,9 +7,9 @@ import pytest -from fastpt.common.yaml_handler import read_yaml -from fastpt.core.get_conf import PROJECT_NAME, EMAIL_REPORT_SEND, DING_TALK_REPORT_SEND, LARK_TALK_REPORT_SEND -from fastpt.core.path_conf import ( +from httpfpt.common.yaml_handler import read_yaml +from httpfpt.core.get_conf import PROJECT_NAME, EMAIL_REPORT_SEND, DING_TALK_REPORT_SEND, LARK_TALK_REPORT_SEND +from httpfpt.core.path_conf import ( HTML_REPORT_PATH, ALLURE_REPORT_PATH, ALLURE_ENV_FILE, @@ -17,11 +17,11 @@ ALLURE_REPORT_HTML_PATH, YAML_REPORT_PATH, ) -from fastpt.db.redis_db import RedisDB -from fastpt.utils.relate_testcase_executor import get_all_testcase_id, get_all_testcase_data -from fastpt.utils.send_report.ding_talk import DingTalk -from fastpt.utils.send_report.lark_talk import LarkTalk -from fastpt.utils.send_report.send_email import SendMail +from httpfpt.db.redis_db import RedisDB +from httpfpt.utils.relate_testcase_executor import get_all_testcase_id, get_all_testcase_data +from httpfpt.utils.send_report.ding_talk import DingTalk +from httpfpt.utils.send_report.lark_talk import LarkTalk +from httpfpt.utils.send_report.send_email import SendMail def run( diff --git a/fastpt/schemas/__init__.py b/httpfpt/schemas/__init__.py similarity index 100% rename from fastpt/schemas/__init__.py rename to httpfpt/schemas/__init__.py diff --git a/fastpt/schemas/case_data.py b/httpfpt/schemas/case_data.py similarity index 100% rename from fastpt/schemas/case_data.py rename to httpfpt/schemas/case_data.py diff --git a/fastpt/templates/email_report.html b/httpfpt/templates/email_report.html similarity index 100% rename from fastpt/templates/email_report.html rename to httpfpt/templates/email_report.html diff --git a/fastpt/templates/yaml_case_data.yaml b/httpfpt/templates/yaml_case_data.yaml similarity index 100% rename from fastpt/templates/yaml_case_data.yaml rename to httpfpt/templates/yaml_case_data.yaml diff --git a/fastpt/test_case/__init__.py b/httpfpt/test_case/__init__.py similarity index 100% rename from fastpt/test_case/__init__.py rename to httpfpt/test_case/__init__.py diff --git a/fastpt/test_case/test_project/__init__.py b/httpfpt/test_case/test_project/__init__.py similarity index 100% rename from fastpt/test_case/test_project/__init__.py rename to httpfpt/test_case/test_project/__init__.py diff --git a/fastpt/test_case/test_project/test_api.py b/httpfpt/test_case/test_project/test_api.py similarity index 94% rename from fastpt/test_case/test_project/test_api.py rename to httpfpt/test_case/test_project/test_api.py index 0492b05..aeb5bf3 100644 --- a/fastpt/test_case/test_project/test_api.py +++ b/httpfpt/test_case/test_project/test_api.py @@ -4,7 +4,7 @@ import pytest from dirty_equals import IsInt -from fastpt.common.log import log +from httpfpt.common.log import log @allure.epic('demo') diff --git a/fastpt/test_case/test_project/test_api_test_case_template.py b/httpfpt/test_case/test_project/test_api_test_case_template.py similarity index 71% rename from fastpt/test_case/test_project/test_api_test_case_template.py rename to httpfpt/test_case/test_project/test_api_test_case_template.py index 74ad62c..30be3ba 100644 --- a/fastpt/test_case/test_project/test_api_test_case_template.py +++ b/httpfpt/test_case/test_project/test_api_test_case_template.py @@ -5,11 +5,11 @@ import allure import pytest -from fastpt.common.send_request import send_request -from fastpt.common.yaml_handler import read_yaml -from fastpt.core.get_conf import PROJECT_NAME -from fastpt.utils.request.case_data_file_parse import get_request_data -from fastpt.utils.request.ids_extract import get_ids +from httpfpt.common.send_request import send_request +from httpfpt.common.yaml_handler import read_yaml +from httpfpt.core.get_conf import PROJECT_NAME +from httpfpt.utils.request.case_data_file_parse import get_request_data +from httpfpt.utils.request.ids_extract import get_ids request_data = get_request_data( file_data=read_yaml(filename=os.sep.join([PROJECT_NAME, 'api_test_case_template.yaml'])), use_pydantic_verify=True diff --git a/fastpt/test_case/test_project/test_only_skip.py b/httpfpt/test_case/test_project/test_only_skip.py similarity index 69% rename from fastpt/test_case/test_project/test_only_skip.py rename to httpfpt/test_case/test_project/test_only_skip.py index 4f7dc4a..16ad6bb 100644 --- a/fastpt/test_case/test_project/test_only_skip.py +++ b/httpfpt/test_case/test_project/test_only_skip.py @@ -5,11 +5,11 @@ import allure import pytest -from fastpt.common.send_request import send_request -from fastpt.common.yaml_handler import read_yaml -from fastpt.core.get_conf import PROJECT_NAME -from fastpt.utils.request.case_data_file_parse import get_request_data -from fastpt.utils.request.ids_extract import get_ids +from httpfpt.common.send_request import send_request +from httpfpt.common.yaml_handler import read_yaml +from httpfpt.core.get_conf import PROJECT_NAME +from httpfpt.utils.request.case_data_file_parse import get_request_data +from httpfpt.utils.request.ids_extract import get_ids request_data = get_request_data( file_data=read_yaml(filename=os.sep.join([PROJECT_NAME, 'only_skip.yml'])), use_pydantic_verify=False diff --git a/fastpt/test_case/test_project/test_upload_file.py b/httpfpt/test_case/test_project/test_upload_file.py similarity index 70% rename from fastpt/test_case/test_project/test_upload_file.py rename to httpfpt/test_case/test_project/test_upload_file.py index 550e617..85880a9 100644 --- a/fastpt/test_case/test_project/test_upload_file.py +++ b/httpfpt/test_case/test_project/test_upload_file.py @@ -5,11 +5,11 @@ import allure import pytest -from fastpt.common.send_request import send_request -from fastpt.common.yaml_handler import read_yaml -from fastpt.core.get_conf import PROJECT_NAME -from fastpt.utils.request.case_data_file_parse import get_request_data -from fastpt.utils.request.ids_extract import get_ids +from httpfpt.common.send_request import send_request +from httpfpt.common.yaml_handler import read_yaml +from httpfpt.core.get_conf import PROJECT_NAME +from httpfpt.utils.request.case_data_file_parse import get_request_data +from httpfpt.utils.request.ids_extract import get_ids request_data = get_request_data( file_data=read_yaml(filename=os.sep.join([PROJECT_NAME, 'upload_file.yaml'])), use_pydantic_verify=True diff --git a/fastpt/utils/__init__.py b/httpfpt/utils/__init__.py similarity index 100% rename from fastpt/utils/__init__.py rename to httpfpt/utils/__init__.py diff --git a/fastpt/utils/allure_control.py b/httpfpt/utils/allure_control.py similarity index 96% rename from fastpt/utils/allure_control.py rename to httpfpt/utils/allure_control.py index 9142010..f67b44f 100644 --- a/fastpt/utils/allure_control.py +++ b/httpfpt/utils/allure_control.py @@ -6,7 +6,7 @@ import allure from allure_commons.types import AttachmentType -from fastpt.utils.file_control import get_file_property +from httpfpt.utils.file_control import get_file_property def allure_step(step: str, var: Union[str, dict]) -> NoReturn: diff --git a/fastpt/utils/assert_control.py b/httpfpt/utils/assert_control.py similarity index 98% rename from fastpt/utils/assert_control.py rename to httpfpt/utils/assert_control.py index e91a0e5..f47a652 100644 --- a/fastpt/utils/assert_control.py +++ b/httpfpt/utils/assert_control.py @@ -5,9 +5,9 @@ from jsonpath import jsonpath -from fastpt.common.log import log -from fastpt.db.mysql_db import MysqlDB -from fastpt.enums.assert_type import AssertType +from httpfpt.common.log import log +from httpfpt.db.mysql_db import MysqlDB +from httpfpt.enums.assert_type import AssertType class Asserter: @@ -50,7 +50,7 @@ def _code_asserter(self, response: dict, assert_text: str) -> NoReturn: 1. assert 200 == pm.response.get('status_code') 2. assert 'success' != pm.response.get('msg')[1] 3. assert 'com' in pm.response.get('content').get('url') - 4. assert pm.response.get('header').get('fastpt') == IsDict(version=0.0.1) + 4. assert pm.response.get('header').get('httpfpt') == IsDict(version=0.0.1) 5. assert pm.response.get('content').get('id') == IsUUID :param response: diff --git a/fastpt/utils/auth_plugins.py b/httpfpt/utils/auth_plugins.py similarity index 87% rename from fastpt/utils/auth_plugins.py rename to httpfpt/utils/auth_plugins.py index f90c27d..3c4c132 100644 --- a/fastpt/utils/auth_plugins.py +++ b/httpfpt/utils/auth_plugins.py @@ -3,11 +3,11 @@ import requests from jsonpath import jsonpath -from fastpt.common.yaml_handler import read_yaml -from fastpt.core.path_conf import AUTH_CONF_PATH -from fastpt.db.redis_db import RedisDB -from fastpt.enums.request.auth import AuthType -from fastpt.utils.enum_control import get_enum_values +from httpfpt.common.yaml_handler import read_yaml +from httpfpt.core.path_conf import AUTH_CONF_PATH +from httpfpt.db.redis_db import RedisDB +from httpfpt.enums.request.auth import AuthType +from httpfpt.utils.enum_control import get_enum_values auth_data = read_yaml(AUTH_CONF_PATH, filename='auth.yaml') IS_AUTH = auth_data['is_auth'] diff --git a/fastpt/utils/case_auto_generator.py b/httpfpt/utils/case_auto_generator.py similarity index 88% rename from fastpt/utils/case_auto_generator.py rename to httpfpt/utils/case_auto_generator.py index 493ad8b..fad98ef 100644 --- a/fastpt/utils/case_auto_generator.py +++ b/httpfpt/utils/case_auto_generator.py @@ -6,9 +6,9 @@ import typer -from fastpt.core.get_conf import PROJECT_NAME -from fastpt.core.path_conf import TEST_CASE_PATH -from fastpt.utils.file_control import search_all_case_yaml_files, search_all_test_case_files, get_file_property +from httpfpt.core.get_conf import PROJECT_NAME +from httpfpt.core.path_conf import TEST_CASE_PATH +from httpfpt.utils.file_control import search_all_case_yaml_files, search_all_test_case_files, get_file_property def auto_generate_test_cases(rewrite: bool = False) -> NoReturn: @@ -69,11 +69,11 @@ def auto_generate_test_cases(rewrite: bool = False) -> NoReturn: import allure import pytest -from fastpt.common.send_request import send_request -from fastpt.common.yaml_handler import read_yaml -from fastpt.core.get_conf import PROJECT_NAME -from fastpt.utils.request.case_data_file_parse import get_request_data -from fastpt.utils.request.ids_extract import get_ids +from httpfpt.common.send_request import send_request +from httpfpt.common.yaml_handler import read_yaml +from httpfpt.core.get_conf import PROJECT_NAME +from httpfpt.utils.request.case_data_file_parse import get_request_data +from httpfpt.utils.request.ids_extract import get_ids request_data = get_request_data( file_data=read_yaml(filename=os.sep.join([PROJECT_NAME, '{yaml_filename}'])), use_pydantic_verify=False diff --git a/fastpt/utils/data_manage/__init__.py b/httpfpt/utils/data_manage/__init__.py similarity index 100% rename from fastpt/utils/data_manage/__init__.py rename to httpfpt/utils/data_manage/__init__.py diff --git a/fastpt/utils/data_manage/apifox.py b/httpfpt/utils/data_manage/apifox.py similarity index 94% rename from fastpt/utils/data_manage/apifox.py rename to httpfpt/utils/data_manage/apifox.py index ede8201..6c5c717 100644 --- a/fastpt/utils/data_manage/apifox.py +++ b/httpfpt/utils/data_manage/apifox.py @@ -6,12 +6,12 @@ import typer -from fastpt.common.json_handler import read_json_file -from fastpt.common.yaml_handler import write_yaml -from fastpt.core.get_conf import PROJECT_NAME -from fastpt.core.path_conf import YAML_DATA_PATH -from fastpt.utils.data_manage.base_format import format_value -from fastpt.utils.file_control import get_file_property +from httpfpt.common.json_handler import read_json_file +from httpfpt.common.yaml_handler import write_yaml +from httpfpt.core.get_conf import PROJECT_NAME +from httpfpt.core.path_conf import YAML_DATA_PATH +from httpfpt.utils.data_manage.base_format import format_value +from httpfpt.utils.file_control import get_file_property class ApiFoxParser: diff --git a/fastpt/utils/data_manage/base_format.py b/httpfpt/utils/data_manage/base_format.py similarity index 100% rename from fastpt/utils/data_manage/base_format.py rename to httpfpt/utils/data_manage/base_format.py diff --git a/fastpt/utils/data_manage/git_repo.py b/httpfpt/utils/data_manage/git_repo.py similarity index 100% rename from fastpt/utils/data_manage/git_repo.py rename to httpfpt/utils/data_manage/git_repo.py diff --git a/fastpt/utils/data_manage/har.py b/httpfpt/utils/data_manage/har.py similarity index 100% rename from fastpt/utils/data_manage/har.py rename to httpfpt/utils/data_manage/har.py diff --git a/fastpt/utils/data_manage/jmeter.py b/httpfpt/utils/data_manage/jmeter.py similarity index 100% rename from fastpt/utils/data_manage/jmeter.py rename to httpfpt/utils/data_manage/jmeter.py diff --git a/fastpt/utils/data_manage/openapi.py b/httpfpt/utils/data_manage/openapi.py similarity index 97% rename from fastpt/utils/data_manage/openapi.py rename to httpfpt/utils/data_manage/openapi.py index 8373223..4eedad3 100644 --- a/fastpt/utils/data_manage/openapi.py +++ b/httpfpt/utils/data_manage/openapi.py @@ -8,13 +8,13 @@ import requests import typer -from fastpt.common.json_handler import read_json_file -from fastpt.common.yaml_handler import write_yaml -from fastpt.core.get_conf import PROJECT_NAME -from fastpt.core.path_conf import YAML_DATA_PATH -from fastpt.utils.data_manage.base_format import format_value -from fastpt.utils.file_control import get_file_property -from fastpt.utils.time_control import get_current_timestamp +from httpfpt.common.json_handler import read_json_file +from httpfpt.common.yaml_handler import write_yaml +from httpfpt.core.get_conf import PROJECT_NAME +from httpfpt.core.path_conf import YAML_DATA_PATH +from httpfpt.utils.data_manage.base_format import format_value +from httpfpt.utils.file_control import get_file_property +from httpfpt.utils.time_control import get_current_timestamp class SwaggerParser: diff --git a/fastpt/utils/data_manage/postman.py b/httpfpt/utils/data_manage/postman.py similarity index 100% rename from fastpt/utils/data_manage/postman.py rename to httpfpt/utils/data_manage/postman.py diff --git a/fastpt/utils/enum_control.py b/httpfpt/utils/enum_control.py similarity index 100% rename from fastpt/utils/enum_control.py rename to httpfpt/utils/enum_control.py diff --git a/fastpt/utils/file_control.py b/httpfpt/utils/file_control.py similarity index 90% rename from fastpt/utils/file_control.py rename to httpfpt/utils/file_control.py index 10a83e3..ffdb35d 100644 --- a/fastpt/utils/file_control.py +++ b/httpfpt/utils/file_control.py @@ -5,8 +5,8 @@ from pathlib import Path from typing import Tuple -from fastpt.core.get_conf import PROJECT_NAME -from fastpt.core.path_conf import YAML_DATA_PATH, TEST_CASE_PATH +from httpfpt.core.get_conf import PROJECT_NAME +from httpfpt.core.path_conf import YAML_DATA_PATH, TEST_CASE_PATH def get_file_property(filepath: str) -> Tuple[str, str, str]: diff --git a/fastpt/utils/relate_testcase_executor.py b/httpfpt/utils/relate_testcase_executor.py similarity index 94% rename from fastpt/utils/relate_testcase_executor.py rename to httpfpt/utils/relate_testcase_executor.py index b17f2c2..21e1aa5 100644 --- a/fastpt/utils/relate_testcase_executor.py +++ b/httpfpt/utils/relate_testcase_executor.py @@ -5,14 +5,14 @@ from jsonpath import jsonpath -from fastpt.common.log import log -from fastpt.common.variable_cache import VariableCache -from fastpt.common.yaml_handler import read_yaml -from fastpt.db.redis_db import RedisDB -from fastpt.utils.allure_control import allure_step -from fastpt.utils.file_control import search_all_case_yaml_files, get_file_property -from fastpt.utils.request.request_data_parse import RequestDataParse -from fastpt.utils.request.vars_extractor import VarsExtractor +from httpfpt.common.log import log +from httpfpt.common.variable_cache import VariableCache +from httpfpt.common.yaml_handler import read_yaml +from httpfpt.db.redis_db import RedisDB +from httpfpt.utils.allure_control import allure_step +from httpfpt.utils.file_control import search_all_case_yaml_files, get_file_property +from httpfpt.utils.request.request_data_parse import RequestDataParse +from httpfpt.utils.request.vars_extractor import VarsExtractor def get_all_testcase_id(case_data_list: list) -> list: @@ -219,7 +219,7 @@ def relate_testcase_set_var(testcase_data: dict) -> NoReturn: :param testcase_data: :return: """ - from fastpt.common.send_request import send_request + from httpfpt.common.send_request import send_request msg = '执行变量提取关联测试用例:{}'.format(testcase_data['test_steps']['case_id']) log.debug(msg) @@ -239,7 +239,7 @@ def relate_testcase_exec(testcase_data: dict) -> NoReturn: :param testcase_data: :return: """ - from fastpt.common.send_request import send_request + from httpfpt.common.send_request import send_request msg = '执行关联测试用例:{}'.format(testcase_data['test_steps']['case_id']) log.debug(msg) diff --git a/fastpt/utils/request/__init__.py b/httpfpt/utils/request/__init__.py similarity index 100% rename from fastpt/utils/request/__init__.py rename to httpfpt/utils/request/__init__.py diff --git a/fastpt/utils/request/case_data_file_parse.py b/httpfpt/utils/request/case_data_file_parse.py similarity index 97% rename from fastpt/utils/request/case_data_file_parse.py rename to httpfpt/utils/request/case_data_file_parse.py index 988fb5c..507822b 100644 --- a/fastpt/utils/request/case_data_file_parse.py +++ b/httpfpt/utils/request/case_data_file_parse.py @@ -3,7 +3,7 @@ import copy from typing import List, Dict, Any -from fastpt.schemas.case_data import CaseData +from httpfpt.schemas.case_data import CaseData def get_request_data(*, file_data: dict, use_pydantic_verify: bool = False) -> List[Dict[str, Dict[str, Any]]]: diff --git a/fastpt/utils/request/hooks_executor.py b/httpfpt/utils/request/hooks_executor.py similarity index 95% rename from fastpt/utils/request/hooks_executor.py rename to httpfpt/utils/request/hooks_executor.py index aa480d9..dcd9f8f 100644 --- a/fastpt/utils/request/hooks_executor.py +++ b/httpfpt/utils/request/hooks_executor.py @@ -3,7 +3,7 @@ import re from typing import Any, NoReturn, Union -from fastpt.common.log import log +from httpfpt.common.log import log class HookExecutor: @@ -46,7 +46,7 @@ def hook_func_value_replace(self, target: dict) -> Any: del target['test_steps']['teardown']['hooks'] str_target = str(target) - exec('from fastpt.data.hooks import *') + exec('from httpfpt.data.hooks import *') while re.findall(self.func_re, str_target): key = re.search(self.func_re, str_target) hook_key = key.group(1) @@ -79,7 +79,7 @@ def exec_hook_func(self, func_list: list) -> NoReturn: :return: """ func_list = self.hook_func_extract(func_list) - exec('from fastpt.data.hooks import *') + exec('from httpfpt.data.hooks import *') for func in func_list: log.info(f'执行 hook:{func}') exec(func) diff --git a/fastpt/utils/request/ids_extract.py b/httpfpt/utils/request/ids_extract.py similarity index 100% rename from fastpt/utils/request/ids_extract.py rename to httpfpt/utils/request/ids_extract.py diff --git a/fastpt/utils/request/request_data_parse.py b/httpfpt/utils/request/request_data_parse.py similarity index 97% rename from fastpt/utils/request/request_data_parse.py rename to httpfpt/utils/request/request_data_parse.py index 9fe1926..fbfe40c 100644 --- a/fastpt/utils/request/request_data_parse.py +++ b/httpfpt/utils/request/request_data_parse.py @@ -7,18 +7,18 @@ import allure from _pytest.outcomes import Skipped -from fastpt.common.env_handler import get_env_dict -from fastpt.common.log import log -from fastpt.core.path_conf import RUN_ENV_PATH -from fastpt.enums.allure_severity_type import SeverityType -from fastpt.enums.request.auth import AuthType -from fastpt.enums.request.body import BodyType -from fastpt.enums.request.engin import EnginType -from fastpt.enums.request.method import MethodType -from fastpt.utils.auth_plugins import IS_AUTH, AUTH_TYPE, AuthPlugins -from fastpt.utils.enum_control import get_enum_values -from fastpt.utils.request.hooks_executor import HookExecutor -from fastpt.utils.request.vars_extractor import VarsExtractor +from httpfpt.common.env_handler import get_env_dict +from httpfpt.common.log import log +from httpfpt.core.path_conf import RUN_ENV_PATH +from httpfpt.enums.allure_severity_type import SeverityType +from httpfpt.enums.request.auth import AuthType +from httpfpt.enums.request.body import BodyType +from httpfpt.enums.request.engin import EnginType +from httpfpt.enums.request.method import MethodType +from httpfpt.utils.auth_plugins import IS_AUTH, AUTH_TYPE, AuthPlugins +from httpfpt.utils.enum_control import get_enum_values +from httpfpt.utils.request.hooks_executor import HookExecutor +from httpfpt.utils.request.vars_extractor import VarsExtractor RequestParamGetError = (KeyError, TypeError) diff --git a/fastpt/utils/request/vars_extractor.py b/httpfpt/utils/request/vars_extractor.py similarity index 93% rename from fastpt/utils/request/vars_extractor.py rename to httpfpt/utils/request/vars_extractor.py index bf36754..d0a1eae 100644 --- a/fastpt/utils/request/vars_extractor.py +++ b/httpfpt/utils/request/vars_extractor.py @@ -6,12 +6,12 @@ from jsonpath import jsonpath -from fastpt.common.env_handler import get_env_dict, write_env_vars -from fastpt.common.log import log -from fastpt.common.variable_cache import VariableCache -from fastpt.common.yaml_handler import read_yaml, write_yaml_vars -from fastpt.core.path_conf import TEST_DATA_PATH, RUN_ENV_PATH -from fastpt.enums.var_type import VarType +from httpfpt.common.env_handler import get_env_dict, write_env_vars +from httpfpt.common.log import log +from httpfpt.common.variable_cache import VariableCache +from httpfpt.common.yaml_handler import read_yaml, write_yaml_vars +from httpfpt.core.path_conf import TEST_DATA_PATH, RUN_ENV_PATH +from httpfpt.enums.var_type import VarType class VarsExtractor: diff --git a/fastpt/utils/send_report/__init__.py b/httpfpt/utils/send_report/__init__.py similarity index 100% rename from fastpt/utils/send_report/__init__.py rename to httpfpt/utils/send_report/__init__.py diff --git a/fastpt/utils/send_report/ding_talk.py b/httpfpt/utils/send_report/ding_talk.py similarity index 95% rename from fastpt/utils/send_report/ding_talk.py rename to httpfpt/utils/send_report/ding_talk.py index 7360a22..3129b99 100644 --- a/fastpt/utils/send_report/ding_talk.py +++ b/httpfpt/utils/send_report/ding_talk.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- from typing import NoReturn -from fastpt.common.log import log -from fastpt.core import get_conf +from httpfpt.common.log import log +from httpfpt.core import get_conf class DingTalk: diff --git a/fastpt/utils/send_report/lark_talk.py b/httpfpt/utils/send_report/lark_talk.py similarity index 96% rename from fastpt/utils/send_report/lark_talk.py rename to httpfpt/utils/send_report/lark_talk.py index d637c8d..caed64c 100644 --- a/fastpt/utils/send_report/lark_talk.py +++ b/httpfpt/utils/send_report/lark_talk.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- from typing import NoReturn -from fastpt.common.log import log -from fastpt.core import get_conf +from httpfpt.common.log import log +from httpfpt.core import get_conf class LarkTalk: diff --git a/fastpt/utils/send_report/send_email.py b/httpfpt/utils/send_report/send_email.py similarity index 92% rename from fastpt/utils/send_report/send_email.py rename to httpfpt/utils/send_report/send_email.py index 3e25a24..6485687 100644 --- a/fastpt/utils/send_report/send_email.py +++ b/httpfpt/utils/send_report/send_email.py @@ -10,10 +10,10 @@ from jinja2 import Template -from fastpt.common.log import log -from fastpt.core import get_conf -from fastpt.core.path_conf import HTML_EMAIL_REPORT_PATH -from fastpt.utils.file_control import get_file_property +from httpfpt.common.log import log +from httpfpt.core import get_conf +from httpfpt.core.path_conf import HTML_EMAIL_REPORT_PATH +from httpfpt.utils.file_control import get_file_property class SendMail: diff --git a/fastpt/utils/time_control.py b/httpfpt/utils/time_control.py similarity index 100% rename from fastpt/utils/time_control.py rename to httpfpt/utils/time_control.py