cli-test-framework 0.2.3__tar.gz → 0.2.4__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 (54) hide show
  1. {cli_test_framework-0.2.3/src/cli_test_framework.egg-info → cli_test_framework-0.2.4}/PKG-INFO +1 -1
  2. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/setup.py +1 -1
  3. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/__init__.py +1 -1
  4. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/utils/path_resolver.py +13 -3
  5. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4/src/cli_test_framework.egg-info}/PKG-INFO +1 -1
  6. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/CHANGELOG.md +0 -0
  7. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/MANIFEST.in +0 -0
  8. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/README.md +0 -0
  9. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/docs/user_manual.md +0 -0
  10. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/pyproject.toml +0 -0
  11. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/setup.cfg +0 -0
  12. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/cli.py +0 -0
  13. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/commands/__init__.py +0 -0
  14. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/commands/compare.py +0 -0
  15. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/core/__init__.py +0 -0
  16. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/core/assertions.py +0 -0
  17. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/core/base_runner.py +0 -0
  18. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/core/parallel_runner.py +0 -0
  19. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/core/process_worker.py +0 -0
  20. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/core/test_case.py +0 -0
  21. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/file_comparator/__init__.py +0 -0
  22. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/file_comparator/base_comparator.py +0 -0
  23. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/file_comparator/binary_comparator.py +0 -0
  24. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/file_comparator/csv_comparator.py +0 -0
  25. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/file_comparator/factory.py +0 -0
  26. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/file_comparator/h5_comparator.py +0 -0
  27. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/file_comparator/json_comparator.py +0 -0
  28. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/file_comparator/result.py +0 -0
  29. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/file_comparator/text_comparator.py +0 -0
  30. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/file_comparator/xml_comparator.py +0 -0
  31. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/runners/__init__.py +0 -0
  32. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/runners/json_runner.py +0 -0
  33. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/runners/parallel_json_runner.py +0 -0
  34. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/runners/yaml_runner.py +0 -0
  35. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/utils/__init__.py +0 -0
  36. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework/utils/report_generator.py +0 -0
  37. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework.egg-info/SOURCES.txt +0 -0
  38. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework.egg-info/dependency_links.txt +0 -0
  39. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework.egg-info/entry_points.txt +0 -0
  40. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework.egg-info/requires.txt +0 -0
  41. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/src/cli_test_framework.egg-info/top_level.txt +0 -0
  42. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/tests/__init__.py +0 -0
  43. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/tests/__pycache__/__init__.cpython-312.pyc +0 -0
  44. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/tests/__pycache__/test_parallel_runner.cpython-312-pytest-7.4.4.pyc +0 -0
  45. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/tests/fixtures/test_cases.json +0 -0
  46. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/tests/fixtures/test_cases.yaml +0 -0
  47. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/tests/fixtures/test_cases1.json +0 -0
  48. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/tests/performance_test.py +0 -0
  49. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/tests/test1.py +0 -0
  50. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/tests/test_comprehensive_space.py +0 -0
  51. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/tests/test_parallel_runner.py +0 -0
  52. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/tests/test_parallel_space.py +0 -0
  53. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/tests/test_report.txt +0 -0
  54. {cli_test_framework-0.2.3 → cli_test_framework-0.2.4}/tests/test_runners.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cli-test-framework
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: A small command line testing framework in Python with file comparison capabilities.
5
5
  Home-page: https://github.com/yourusername/cli-test-framework
6
6
  Author: Xiaotong Wang
@@ -8,7 +8,7 @@ with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
8
8
 
9
9
  setup(
10
10
  name="cli-test-framework",
11
- version="0.2.3",
11
+ version="0.2.4",
12
12
  author="Xiaotong Wang",
13
13
  author_email="xiaotongwang98@gmail.com",
14
14
  description="A small command line testing framework in Python with file comparison capabilities.",
@@ -5,7 +5,7 @@ This package provides tools for testing command-line applications and scripts
5
5
  with support for parallel execution and advanced file comparison capabilities.
6
6
  """
7
7
 
8
- __version__ = "0.2.3"
8
+ __version__ = "0.2.4"
9
9
  __author__ = "Xiaotong Wang"
10
10
  __email__ = "xiaotongwang98@gmail.com"
11
11
 
@@ -2,6 +2,7 @@ from pathlib import Path
2
2
  from typing import List
3
3
  import shlex
4
4
  import os
5
+ import shutil
5
6
 
6
7
  class PathResolver:
7
8
  def __init__(self, workspace: Path):
@@ -24,9 +25,18 @@ class PathResolver:
24
25
  """
25
26
  解析命令路径
26
27
  - 系统命令(如echo, ping, dir等)保持原样
28
+ - 已安装的命令(在PATH中可找到)保持原样
27
29
  - 相对路径的可执行文件转换为绝对路径
28
30
  """
29
- # 常见的系统命令列表
31
+ # 如果是绝对路径,保持原样
32
+ if Path(command).is_absolute():
33
+ return command
34
+
35
+ # 检查命令是否在系统PATH中
36
+ if shutil.which(command) is not None:
37
+ return command
38
+
39
+ # 常见的系统命令列表(作为备用,以防shutil.which在某些情况下失效)
30
40
  system_commands = {
31
41
  'echo', 'ping', 'dir', 'ls', 'cat', 'grep', 'find', 'sort',
32
42
  'head', 'tail', 'wc', 'curl', 'wget', 'git', 'python', 'node',
@@ -34,8 +44,8 @@ class PathResolver:
34
44
  'kubectl', 'helm', 'terraform', 'ansible', 'ssh', 'scp', 'rsync'
35
45
  }
36
46
 
37
- # 如果是系统命令或绝对路径,保持原样
38
- if command in system_commands or Path(command).is_absolute():
47
+ # 如果在系统命令列表中,保持原样
48
+ if command in system_commands:
39
49
  return command
40
50
 
41
51
  # 否则当作相对路径处理
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cli-test-framework
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: A small command line testing framework in Python with file comparison capabilities.
5
5
  Home-page: https://github.com/yourusername/cli-test-framework
6
6
  Author: Xiaotong Wang