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

fix: support non alpha key at root level #54

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "drools_jpy"
version = "0.3.6"
version = "0.3.7"
authors = [
{ name="Madhu Kanoor", email="author@example.com" },
]
Expand Down
Binary file not shown.
45 changes: 45 additions & 0 deletions tests/asts/test_non_alpha_key_ast.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
- RuleSet:
hosts:
- all
name: Non alpha key
rules:
- Rule:
actions:
- Action:
action: debug
action_args:
msg: First check worked
condition:
AllCondition:
- EqualsExpression:
lhs:
Event: '["http://www.example.com"]'
rhs:
String: down
enabled: true
name: Check key with slash,dot and colon at root level
- Rule:
actions:
- Action:
action: debug
action_args:
msg: Second check worked
condition:
AllCondition:
- EqualsExpression:
lhs:
Event: urls["http://www.example.com"]
rhs:
String: up
enabled: true
name: Check key with slash,dot and colon at non root level
sources:
- EventSource:
name: ansible.eda.generic
source_args:
payload:
- http://www.example.com: down
- urls:
http://www.example.com: up
source_filters: []
source_name: ansible.eda.generic
1 change: 1 addition & 0 deletions tests/test_ruleset.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,7 @@ def test_assert_event_string_search():
"asts/test_delayed_comparison_ast.yml",
"asts/test_squaredaccessor_cases_ast.yml",
"asts/test_squaredaccessor_selectattr_cases_ast.yml",
"asts/test_non_alpha_key_ast.yml",
],
)
def test_integrated(rulebook):
Expand Down