drun 2.2.2__tar.gz → 2.3.0__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.
- {drun-2.2.2 → drun-2.3.0}/PKG-INFO +1 -1
- {drun-2.2.2 → drun-2.3.0}/drun/__init__.py +1 -1
- {drun-2.2.2 → drun-2.3.0}/drun/loader/yaml_loader.py +12 -1
- {drun-2.2.2 → drun-2.3.0}/drun/scaffolds/templates.py +1 -1
- {drun-2.2.2 → drun-2.3.0}/drun.egg-info/PKG-INFO +1 -1
- {drun-2.2.2 → drun-2.3.0}/drun.egg-info/SOURCES.txt +2 -1
- {drun-2.2.2 → drun-2.3.0}/pyproject.toml +1 -1
- drun-2.3.0/tests/test_csv_path_resolution.py +75 -0
- {drun-2.2.2 → drun-2.3.0}/LICENSE +0 -0
- {drun-2.2.2 → drun-2.3.0}/README.md +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/cli.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/db/__init__.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/db/database_proxy.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/db/generate_mysql_config.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/engine/__init__.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/engine/http.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/exporters/curl.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/importers/base.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/importers/curl.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/importers/har.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/importers/openapi.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/importers/postman.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/loader/__init__.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/loader/collector.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/loader/env.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/loader/hooks.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/models/case.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/models/config.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/models/report.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/models/request.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/models/step.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/models/validators.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/notifier/__init__.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/notifier/base.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/notifier/dingtalk.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/notifier/emailer.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/notifier/feishu.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/notifier/format.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/reporter/__init__.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/reporter/allure_reporter.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/reporter/html_reporter.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/reporter/json_reporter.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/runner/__init__.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/runner/assertions.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/runner/extractors.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/runner/runner.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/scaffolds/__init__.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/templating/__init__.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/templating/builtins.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/templating/context.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/templating/engine.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/utils/__init__.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/utils/curl.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/utils/errors.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/utils/logging.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/utils/mask.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun/utils/timeit.py +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun.egg-info/dependency_links.txt +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun.egg-info/entry_points.txt +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun.egg-info/requires.txt +0 -0
- {drun-2.2.2 → drun-2.3.0}/drun.egg-info/top_level.txt +0 -0
- {drun-2.2.2 → drun-2.3.0}/setup.cfg +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__all__ = ["__version__"]
|
|
2
|
-
__version__ = "2.
|
|
2
|
+
__version__ = "2.3.0"
|
|
@@ -423,10 +423,21 @@ def _find_request_subfield_location(raw_text: str, step_index: int, subfield: st
|
|
|
423
423
|
|
|
424
424
|
|
|
425
425
|
def _resolve_csv_path(path_value: str, source_path: Path | None) -> Path:
|
|
426
|
+
from drun.loader.hooks import find_hooks
|
|
427
|
+
|
|
426
428
|
candidate = Path(path_value).expanduser()
|
|
427
429
|
if candidate.is_absolute():
|
|
428
430
|
return candidate
|
|
429
|
-
|
|
431
|
+
|
|
432
|
+
base: Path | None = None
|
|
433
|
+
if source_path:
|
|
434
|
+
hooks_path = find_hooks(source_path)
|
|
435
|
+
if hooks_path:
|
|
436
|
+
base = hooks_path.parent.resolve()
|
|
437
|
+
|
|
438
|
+
if base is None:
|
|
439
|
+
base = Path.cwd().resolve()
|
|
440
|
+
|
|
430
441
|
return (base / candidate).resolve()
|
|
431
442
|
|
|
432
443
|
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"""Tests for CSV parameter path resolution behaviour"""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import unittest
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from tempfile import TemporaryDirectory
|
|
9
|
+
|
|
10
|
+
from drun.loader.yaml_loader import _resolve_csv_path
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ResolveCsvPathTests(unittest.TestCase):
|
|
14
|
+
def test_paths_can_resolve_via_project_root_hooks(self) -> None:
|
|
15
|
+
with TemporaryDirectory() as tmp:
|
|
16
|
+
project_root = Path(tmp)
|
|
17
|
+
hooks_path = project_root / "drun_hooks.py"
|
|
18
|
+
hooks_path.write_text("# hooks\n")
|
|
19
|
+
|
|
20
|
+
testcases_dir = project_root / "testcases"
|
|
21
|
+
testcases_dir.mkdir()
|
|
22
|
+
|
|
23
|
+
data_dir = project_root / "data"
|
|
24
|
+
data_dir.mkdir()
|
|
25
|
+
csv_file = data_dir / "users.csv"
|
|
26
|
+
csv_file.write_text("username\n")
|
|
27
|
+
|
|
28
|
+
testcase_path = testcases_dir / "demo.yaml"
|
|
29
|
+
testcase_path.write_text("config: {}\n")
|
|
30
|
+
|
|
31
|
+
resolved = _resolve_csv_path("data/users.csv", testcase_path)
|
|
32
|
+
|
|
33
|
+
self.assertEqual(resolved, csv_file.resolve())
|
|
34
|
+
|
|
35
|
+
def test_paths_fallback_to_cwd_when_no_hooks(self) -> None:
|
|
36
|
+
with TemporaryDirectory() as tmp:
|
|
37
|
+
project_root = Path(tmp)
|
|
38
|
+
data_dir = project_root / "data"
|
|
39
|
+
data_dir.mkdir()
|
|
40
|
+
csv_file = data_dir / "users.csv"
|
|
41
|
+
csv_file.write_text("username\n")
|
|
42
|
+
|
|
43
|
+
testcases_dir = project_root / "testcases"
|
|
44
|
+
testcases_dir.mkdir()
|
|
45
|
+
testcase_path = testcases_dir / "demo.yaml"
|
|
46
|
+
testcase_path.write_text("config: {}\n")
|
|
47
|
+
|
|
48
|
+
previous_cwd = os.getcwd()
|
|
49
|
+
try:
|
|
50
|
+
os.chdir(project_root)
|
|
51
|
+
resolved = _resolve_csv_path("data/users.csv", testcase_path)
|
|
52
|
+
finally:
|
|
53
|
+
os.chdir(previous_cwd)
|
|
54
|
+
|
|
55
|
+
self.assertEqual(resolved, csv_file.resolve())
|
|
56
|
+
|
|
57
|
+
def test_legacy_relative_paths_resolve_outside_project(self) -> None:
|
|
58
|
+
with TemporaryDirectory() as tmp:
|
|
59
|
+
project_root = Path(tmp)
|
|
60
|
+
hooks_path = project_root / "drun_hooks.py"
|
|
61
|
+
hooks_path.write_text("# hooks\n")
|
|
62
|
+
|
|
63
|
+
testcases_dir = project_root / "testcases"
|
|
64
|
+
testcases_dir.mkdir()
|
|
65
|
+
testcase_path = testcases_dir / "demo.yaml"
|
|
66
|
+
testcase_path.write_text("config: {}\n")
|
|
67
|
+
|
|
68
|
+
resolved = _resolve_csv_path("../data/users.csv", testcase_path)
|
|
69
|
+
|
|
70
|
+
expected = (project_root / "../data/users.csv").resolve()
|
|
71
|
+
self.assertEqual(resolved, expected)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
if __name__ == "__main__":
|
|
75
|
+
unittest.main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|