Skip to content

Commit cd263cb

Browse files
Test list parsing key-display whitespace normalization
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 096973c commit cd263cb

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/test_list_parsing_utils.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,19 @@ def test_parse_mapping_list_items_falls_back_when_key_display_returns_blank_stri
144144
)
145145

146146

147+
def test_parse_mapping_list_items_strips_surrounding_whitespace_in_key_display():
148+
with pytest.raises(
149+
HyperbrowserError,
150+
match="Failed to read demo object value for key 'field' at index 0",
151+
):
152+
parse_mapping_list_items(
153+
[_ExplodingValueMapping()],
154+
item_label="demo",
155+
parse_item=lambda payload: payload,
156+
key_display=lambda key: f" {key} ",
157+
)
158+
159+
147160
def test_parse_mapping_list_items_falls_back_when_key_display_returns_control_chars():
148161
with pytest.raises(
149162
HyperbrowserError,

0 commit comments

Comments
 (0)