api-engine-xin 0.0.25__tar.gz → 0.0.26__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 (32) hide show
  1. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/core.py +15 -0
  2. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/engine/base_case.py +3 -3
  3. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/PKG-INFO +1 -1
  4. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/api_engine_xin.egg-info/PKG-INFO +1 -1
  5. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/api_engine_xin.egg-info/SOURCES.txt +0 -1
  6. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/setup.py +1 -1
  7. api_engine_xin-0.0.25/ApiEngine/BaseCase.py +0 -2
  8. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/__init__.py +0 -0
  9. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/engine/__init__.py +0 -0
  10. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/engine/assertion.py +0 -0
  11. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/engine/extractor.py +0 -0
  12. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/engine/precondition.py +0 -0
  13. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/engine/replacer.py +0 -0
  14. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/engine/script_runner.py +0 -0
  15. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/http/__init__.py +0 -0
  16. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/http/client.py +0 -0
  17. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/http/files.py +0 -0
  18. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/infra/__init__.py +0 -0
  19. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/infra/case_log.py +0 -0
  20. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/infra/db_client.py +0 -0
  21. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/infra/exceptions.py +0 -0
  22. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/infra/global_func.py +0 -0
  23. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/ApiEngine/infra/test_result.py +0 -0
  24. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/LICENSE +0 -0
  25. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/README.md +0 -0
  26. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/api_engine_xin.egg-info/dependency_links.txt +0 -0
  27. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/api_engine_xin.egg-info/requires.txt +0 -0
  28. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/api_engine_xin.egg-info/top_level.txt +0 -0
  29. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/setup.cfg +0 -0
  30. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/tests/Tools.py +0 -0
  31. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/tests/__init__.py +0 -0
  32. {api_engine_xin-0.0.25 → api_engine_xin-0.0.26}/tests/runTest.py +0 -0
@@ -111,6 +111,21 @@ class TestRunner:
111
111
  global_func.__dict__.update(builtins)
112
112
  exec(_gf, global_func.__dict__)
113
113
 
114
+ def get_env_snapshot(self) -> dict:
115
+ """获取执行后的环境变量快照(供上层平台读取)
116
+
117
+ 返回包含 envs、debug_updates 的字典,
118
+ 用于上层平台同步临时变量和持久化全局变量变更。
119
+
120
+ debug_updates 中的约定:
121
+ - value 非 None → 新增/更新全局变量
122
+ - value 为 None → 删除全局变量
123
+ """
124
+ return {
125
+ "envs": copy.deepcopy(dict(self._shared_env.get("envs") or {})),
126
+ "debug_updates": copy.deepcopy(self._shared_env.get("debug_updates") or {}),
127
+ }
128
+
114
129
 
115
130
  if __name__ == '__main__':
116
131
  import os
@@ -284,11 +284,11 @@ class BaseCase(CaseLogHandler):
284
284
  envs = self._shared_env.get("envs")
285
285
  if isinstance(envs, dict) and key in envs:
286
286
  del envs[key]
287
- # debug_updates 中移除,上层不再同步该变量到DB
287
+ # debug_updates 中标记为 None,通知上层从数据库删除
288
288
  try:
289
289
  debug_updates = self._shared_env.get("debug_updates")
290
- if isinstance(debug_updates, dict) and key in debug_updates:
291
- del debug_updates[key]
290
+ if isinstance(debug_updates, dict):
291
+ debug_updates[key] = None
292
292
  except Exception:
293
293
  pass
294
294
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: api_engine_xin
3
- Version: 0.0.25
3
+ Version: 0.0.26
4
4
  Summary: 接口测试平台测试用例执行引擎
5
5
  Home-page: https://pypi.org/project/api_engine_xin/
6
6
  Author: Shawn
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: api-engine-xin
3
- Version: 0.0.25
3
+ Version: 0.0.26
4
4
  Summary: 接口测试平台测试用例执行引擎
5
5
  Home-page: https://pypi.org/project/api_engine_xin/
6
6
  Author: Shawn
@@ -1,7 +1,6 @@
1
1
  LICENSE
2
2
  README.md
3
3
  setup.py
4
- ApiEngine/BaseCase.py
5
4
  ApiEngine/__init__.py
6
5
  ApiEngine/core.py
7
6
  ApiEngine/engine/__init__.py
@@ -9,7 +9,7 @@ with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as fh:
9
9
 
10
10
  setup(
11
11
  name="api_engine_xin",
12
- version="0.0.25",
12
+ version="0.0.26",
13
13
  author="Shawn",
14
14
  author_email="xiaoh0525@xiaoh.com",
15
15
  description="接口测试平台测试用例执行引擎",
@@ -1,2 +0,0 @@
1
- # 向后兼容层 — 旧代码可通过 from ApiEngine.BaseCase import BaseCase 导入
2
- from ApiEngine.engine.base_case import BaseCase
File without changes