File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ def ensure_existing_file_path(
2020 ) from exc
2121 if not isinstance (normalized_path , str ):
2222 raise HyperbrowserError ("file_path must resolve to a string path" )
23- if not normalized_path :
23+ if not normalized_path . strip () :
2424 raise HyperbrowserError ("file_path must not be empty" )
2525 if "\x00 " in normalized_path :
2626 raise HyperbrowserError ("file_path must not contain null bytes" )
Original file line number Diff line number Diff line change @@ -80,6 +80,12 @@ def test_ensure_existing_file_path_rejects_empty_string_paths():
8080 missing_file_message = "missing" ,
8181 not_file_message = "not-file" ,
8282 )
83+ with pytest .raises (HyperbrowserError , match = "file_path must not be empty" ):
84+ ensure_existing_file_path (
85+ " " ,
86+ missing_file_message = "missing" ,
87+ not_file_message = "not-file" ,
88+ )
8389
8490
8591def test_ensure_existing_file_path_rejects_null_byte_paths ():
You can’t perform that action at this time.
0 commit comments