pytest-api-framework-alpha 0.3.19__tar.gz → 0.3.20__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/PKG-INFO +1 -1
  2. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/base_class.py +12 -8
  3. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/pytest_api_framework_alpha.egg-info/PKG-INFO +1 -1
  4. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/setup.py +1 -1
  5. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/__init__.py +0 -0
  6. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/assert_webhook.py +0 -0
  7. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/conftest.py +0 -0
  8. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/db/__init__.py +0 -0
  9. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/db/mysql_db.py +0 -0
  10. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/db/redis_db.py +0 -0
  11. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/exceptions.py +0 -0
  12. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/exit_code.py +0 -0
  13. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/extract.py +0 -0
  14. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/global_attribute.py +0 -0
  15. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/http_client.py +0 -0
  16. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/render_data.py +0 -0
  17. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/report.py +0 -0
  18. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/retry_assert.py +0 -0
  19. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/script.py +0 -0
  20. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/startapp.py +0 -0
  21. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/utils/__init__.py +0 -0
  22. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/utils/common.py +0 -0
  23. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/utils/date_util.py +0 -0
  24. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/utils/encrypt.py +0 -0
  25. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/utils/lark_util.py +0 -0
  26. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/utils/log_util.py +0 -0
  27. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/utils/mock_util.py +0 -0
  28. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/utils/yaml_util.py +0 -0
  29. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/framework/validate.py +0 -0
  30. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/pytest_api_framework_alpha.egg-info/SOURCES.txt +0 -0
  31. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/pytest_api_framework_alpha.egg-info/dependency_links.txt +0 -0
  32. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/pytest_api_framework_alpha.egg-info/requires.txt +0 -0
  33. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/pytest_api_framework_alpha.egg-info/top_level.txt +0 -0
  34. {pytest_api_framework_alpha-0.3.19 → pytest_api_framework_alpha-0.3.20}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-api-framework-alpha
3
- Version: 0.3.19
3
+ Version: 0.3.20
4
4
  Author: alpha
5
5
  Author-email:
6
6
  Requires-Python: >=3.6
@@ -7,7 +7,6 @@ from typing import Union
7
7
  from dataclasses import dataclass
8
8
  from datetime import datetime, timedelta
9
9
  from urllib.parse import urlparse, urlunparse, urljoin
10
- from adodbapi.apibase import pythonTimeConverter
11
10
 
12
11
  import pytest
13
12
  from box import Box
@@ -189,17 +188,21 @@ class BaseTestCase(ExtendBaseTestCase):
189
188
  :return:
190
189
  """
191
190
  account_info = self.context.get(self.belong_app).get("accounts").get(account)
192
- original_webhook_url = account_info.get("webhook_url")
193
- if not original_webhook_url:
194
- self.logger.warning(f"账号{account}未在context配置webhook地址")
195
- return
191
+ info = self.mysql_conn("db_camp_crm").query(
192
+ f"SELECT webhook_url FROM tbl_participant WHERE participant_code = '{account_info.client_id}';",
193
+ log=False)
194
+ if not info:
195
+ # self.logger.warning(f"账号{account}未配置webhook地址")
196
+ return None
197
+ original_webhook_url = info.get("webhook_url").rsplit("/", 1)[0]
196
198
  new_webhook_url = f"{original_webhook_url}/{str(uuid.uuid4()).replace("-", "_")}"
197
199
  try:
198
200
  self.mysql_conn("db_camp_crm").execute(
199
- f"UPDATE tbl_participant set webhook_url = '{new_webhook_url}' WHERE participant_code = '{account_info.client_id}';", log=False)
201
+ f"UPDATE tbl_participant set webhook_url = '{new_webhook_url}' WHERE participant_code = '{account_info.client_id}';",
202
+ log=False)
200
203
  self.context_set(f"{account_info.client_id}_webhook", urlparse(new_webhook_url).path)
201
204
  except Exception as e:
202
- self.logger.error(f"修改webhook地址异常: {e}")
205
+ self.logger.error(f"账号{account}修改webhook地址异常: {e}")
203
206
 
204
207
  def get_webhook(self, account, count=None, timeout=GET_WEBHOOK_TIMEOUT, interval=GET_WEBHOOK_TRIES):
205
208
  """
@@ -213,8 +216,9 @@ class BaseTestCase(ExtendBaseTestCase):
213
216
  """
214
217
  account_info = self.context.get(self.belong_app).get("accounts").get(account)
215
218
  webhook_url = self.context_get(f"{account_info.client_id}_webhook")
219
+
216
220
  if not webhook_url:
217
- self.logger.warning(f"账号{account}未在context配置webhook地址")
221
+ self.logger.warning(f"账号{account}未配置webhook地址")
218
222
  return
219
223
  webhook_url = webhook_url.replace("/webhook_vmock", "")
220
224
  base64_webhook_url = b64_encode(webhook_url.encode("utf8"))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-api-framework-alpha
3
- Version: 0.3.19
3
+ Version: 0.3.20
4
4
  Author: alpha
5
5
  Author-email:
6
6
  Requires-Python: >=3.6
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="pytest-api-framework-alpha", # 包名(必须唯一)
5
- version="0.3.19",
5
+ version="0.3.20",
6
6
  packages=find_packages(),
7
7
  author="alpha",
8
8
  author_email="",