Skip to content

Commit d3dbb23

Browse files
Test extension mixed stringified key normalization
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 138d44a commit d3dbb23

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_extension_utils.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,21 @@ def __str__(self) -> str:
232232
parse_extension_list_response_data({_ControlStringKey(): "value"})
233233

234234

235+
def test_parse_extension_list_response_data_missing_key_handles_strip_and_sanitize_stringified_keys():
236+
class _MixedStringKey:
237+
def __str__(self) -> str:
238+
return " bad\tkey "
239+
240+
with pytest.raises(
241+
HyperbrowserError,
242+
match=(
243+
"Expected 'extensions' key in response but got "
244+
"\\[bad\\?key\\] keys"
245+
),
246+
):
247+
parse_extension_list_response_data({_MixedStringKey(): "value"})
248+
249+
235250
def test_parse_extension_list_response_data_missing_key_handles_string_subclass_str_results():
236251
class _StringSubclassKey:
237252
class _RenderedKey(str):

0 commit comments

Comments
 (0)