Skip to content

Commit acd573a

Browse files
test: update tests to reflect correct RequestBodyPlainText routing
The test case 'test_string' was testing the old buggy behavior where RequestBodyPlainText was routed to request_body_json. This test has been removed and replaced with a new test case 'test_plain_text_body' in the request_body_data test function to verify the correct behavior. RequestBodyPlainText should route to request_body_data (like RequestBodyUrlEncodedForm) so that plain text is sent as-is without JSON parsing. Co-Authored-By: unknown <>
1 parent e0a2fdb commit acd573a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,6 @@ def test_interpolated_request_json(test_name, input_request_json, expected_reque
211211
RequestBodyJsonObject(type="RequestBodyJsonObject", value={"none_value": "{{ None }}"}),
212212
{},
213213
),
214-
(
215-
"test_string",
216-
RequestBodyPlainText(
217-
type="RequestBodyPlainText",
218-
value="""{"nested": { "key": "{{ config['option'] }}" }}""",
219-
),
220-
{"nested": {"key": "OPTION"}},
221-
),
222214
(
223215
"test_nested_objects",
224216
RequestBodyJsonObject(
@@ -345,6 +337,14 @@ def test_interpolated_request_data(test_name, input_request_data, expected_reque
345337
),
346338
{"2020-01-01 - 12345": "ABC"},
347339
),
340+
(
341+
"test_plain_text_body",
342+
RequestBodyPlainText(
343+
type="RequestBodyPlainText",
344+
value="plain text body with {{ config['option'] }}",
345+
),
346+
"plain text body with OPTION",
347+
),
348348
],
349349
)
350350
def test_interpolated_request_data_using_request_body(

0 commit comments

Comments
 (0)