File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,15 @@ def test_format_string_key_for_error_returns_normalized_key():
5050 assert format_string_key_for_error (" \n key\t " , max_length = 20 ) == "?key?"
5151
5252
53+ def test_format_string_key_for_error_uses_default_length_for_non_int_max_length ():
54+ assert format_string_key_for_error ("key" , max_length = "invalid" ) == "key" # type: ignore[arg-type]
55+
56+
57+ def test_format_string_key_for_error_uses_default_length_for_non_positive_max_length ():
58+ assert format_string_key_for_error ("key" , max_length = 0 ) == "key"
59+ assert format_string_key_for_error ("key" , max_length = - 5 ) == "key"
60+
61+
5362def test_format_string_key_for_error_returns_blank_fallback_for_empty_keys ():
5463 assert format_string_key_for_error (" " , max_length = 20 ) == "<blank key>"
5564
You can’t perform that action at this time.
0 commit comments