Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Path Validation and Environment Loading to TreeNode Class #6064

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions avocado/core/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
:param path: Path of this node (must not end with '/')
:param environment: List of pair/key/value items
"""
if not path or path.endswith('/'):
raise ValueError("Path must be non-empty and not end with '/'")

Check warning on line 138 in avocado/core/tree.py

View check run for this annotation

Codecov / codecov/patch

avocado/core/tree.py#L137-L138

Added lines #L137 - L138 were not covered by tests
self.name = path.rsplit("/")[-1]
self.path = path
self.environment = TreeEnvironment()
Expand Down
Loading