File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ def _resolve_glob(path_glob: PathLike | Iterable[PathLike]):
103103
104104 try :
105105 p = Path (path_glob )
106- paths = list (p .parent .glob (p .name )) if p .name == "*.sdf" else list (p )
106+ paths = list (p .parent .glob (p .name )) if p .name . endswith ( "*.sdf" ) else list (p )
107107 except TypeError :
108108 paths = list ({Path (p ) for p in path_glob })
109109
Original file line number Diff line number Diff line change @@ -212,6 +212,18 @@ def test_resolve_glob_from_string_pattern():
212212 assert result == expected
213213
214214
215+ def test_resolve_glob_from_multiple_names_string_pattern (tmp_path ):
216+ mock_test_files_dir = tmp_path
217+ (mock_test_files_dir / "normal_0000.sdf" ).touch ()
218+ (mock_test_files_dir / "normal_0001.sdf" ).touch ()
219+ (mock_test_files_dir / "other_0000.sdf" ).touch ()
220+
221+ pattern = str (mock_test_files_dir / "normal_*.sdf" )
222+ result = _resolve_glob (pattern )
223+ expected = sorted (mock_test_files_dir .glob ("normal_*.sdf" ))
224+ assert result == expected
225+
226+
215227def test_resolve_glob_from_path_glob ():
216228 pattern = TEST_FILES_DIR .glob ("*.sdf" )
217229 result = _resolve_glob (pattern )
You can’t perform that action at this time.
0 commit comments