File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -202,6 +202,36 @@ def __str__(self) -> str:
202202 parse_extension_list_response_data ({_BrokenStringKey (): "value" })
203203
204204
205+ def test_parse_extension_list_response_data_missing_key_handles_blank_stringified_keys ():
206+ class _BlankStringKey :
207+ def __str__ (self ) -> str :
208+ return " "
209+
210+ with pytest .raises (
211+ HyperbrowserError ,
212+ match = (
213+ "Expected 'extensions' key in response but got "
214+ "\\ [<blank key>\\ ] keys"
215+ ),
216+ ):
217+ parse_extension_list_response_data ({_BlankStringKey (): "value" })
218+
219+
220+ def test_parse_extension_list_response_data_missing_key_handles_control_stringified_keys ():
221+ class _ControlStringKey :
222+ def __str__ (self ) -> str :
223+ return "\n \t "
224+
225+ with pytest .raises (
226+ HyperbrowserError ,
227+ match = (
228+ "Expected 'extensions' key in response but got "
229+ "\\ [\\ ?\\ ?\\ ] keys"
230+ ),
231+ ):
232+ parse_extension_list_response_data ({_ControlStringKey (): "value" })
233+
234+
205235def test_parse_extension_list_response_data_missing_key_handles_string_subclass_str_results ():
206236 class _StringSubclassKey :
207237 class _RenderedKey (str ):
You can’t perform that action at this time.
0 commit comments