Skip to content

Commit 0943f2f

Browse files
authored
Merge pull request #8 from stackabletech/bugfix/os-sep-in-test-case-name
Bugfix when using os sep in test case name.
2 parents 9322752 + ec10dd6 commit 0943f2f

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Added
8+
79
- Delete the output dir before generating tests ([#7]).
810

11+
### Changed
12+
13+
- Replace os fs separator ("/") in test case names with underscore ("_") ([#8])
14+
915
[#7]: https://github.com/stackabletech/beku.py/pull/7)
16+
[#8]: https://github.com/stackabletech/beku.py/pull/8)
1017

1118
## [0.0.8] - 2023-07-01
1219

src/beku/kuttl.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,16 @@ class TestCase:
106106

107107
@cached_property
108108
def tid(self) -> str:
109-
"""Return the test id. Used as destination folder name for the generated test case."""
110-
return "_".join(
109+
"""Return the test id. Used as destination folder name for the generated test case.
110+
The result is part of a full directory name of the test case. Therefore, the OS filesystem
111+
directory separator is replaced with underscore.
112+
"""
113+
return re.sub(f"[{os.sep}:]", "_", "_".join(
111114
chain(
112115
[self.name],
113116
[f"{k}-{v}" for k, v in self.values.items()],
114117
)
115-
)
118+
))
116119

117120
def expand(self, template_dir: str, target_dir: str) -> None:
118121
"""Expand test case This will create the target folder, copy files and render render templates."""

0 commit comments

Comments
 (0)