Skip to content

Commit

Permalink
fix example and check it in a test
Browse files Browse the repository at this point in the history
  • Loading branch information
ekneg54 committed Nov 8, 2024
1 parent 8bbb38e commit 8788feb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
3 changes: 1 addition & 2 deletions logprep/processor/requester/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
requester:
url: https://internal.cmdb.local/api/v1/locations
method: POST
content_type: application/json
target_field: cmdb.location
header:
headers:
Authorization: Bearer askdfjpiowejf283u9r
json:
hostname: ${message.hostname}
Expand Down
16 changes: 16 additions & 0 deletions tests/unit/processor/requester/test_requester_rule.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pylint: disable=protected-access
# pylint: disable=missing-docstring
import pytest

from logprep.processor.requester.rule import RequesterRule


Expand All @@ -16,6 +17,21 @@ def test_create_from_dict_returns_requester_rule(self):
@pytest.mark.parametrize(
["rule", "error", "message"],
[
(
{
"filter": "domain",
"requester": {
"url": "https://internal.cmdb.local/api/v1/locations",
"method": "POST",
"target_field": "cmdb.location",
"headers": {"Authorization": "Bearer askdfjpiowejf283u9r"},
"json": {"hostname": "${message.hostname}"},
},
"description": "...",
},
None,
None,
),
(
{
"filter": "message",
Expand Down

0 comments on commit 8788feb

Please sign in to comment.