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,6 +20,8 @@ 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 :
24+ raise HyperbrowserError ("file_path must not be empty" )
2325 if not os .path .exists (normalized_path ):
2426 raise HyperbrowserError (missing_file_message )
2527 if not os .path .isfile (normalized_path ):
Original file line number Diff line number Diff line change @@ -70,3 +70,12 @@ def test_ensure_existing_file_path_rejects_non_string_fspath_results():
7070 missing_file_message = "missing" ,
7171 not_file_message = "not-file" ,
7272 )
73+
74+
75+ def test_ensure_existing_file_path_rejects_empty_string_paths ():
76+ with pytest .raises (HyperbrowserError , match = "file_path must not be empty" ):
77+ ensure_existing_file_path (
78+ "" ,
79+ missing_file_message = "missing" ,
80+ not_file_message = "not-file" ,
81+ )
You can’t perform that action at this time.
0 commit comments