Skip to content

Commit

Permalink
add example requester test case for merging response with existing dict
Browse files Browse the repository at this point in the history
- Introduced a new test case to validate merging response data with an existing dictionary.
- Ensures proper behavior when "merge_with_target" is enabled in the requester configuration.
  • Loading branch information
dtrai2 committed Dec 23, 2024
1 parent 9532f0d commit ae710a8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/unit/processor/requester/test_requester.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,28 @@
"status": 200,
},
),
(
"merge response with existing dict",
{
"filter": "data",
"requester": {
"url": "http://localhost/",
"method": "GET",
"target_field": "data",
"delete_source_fields": True,
"merge_with_target": True,
},
},
{"data": {"existing": "data"}},
{"data": {"existing": "data", "new-data": {"dict": "value"}}},
{
"method": "GET",
"url": "http://localhost/",
"json": {"new-data": {"dict": "value"}},
"content_type": "text/plain",
"status": 200,
},
),
] # testcase, rule, event, expected, response

failure_test_cases = [
Expand Down

0 comments on commit ae710a8

Please sign in to comment.