-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Estimators should be sorted by file names (#782)
* sort list_of_matching_files * add test * convertfrompattern sort files
- Loading branch information
1 parent
694fa3c
commit 54ea587
Showing
2 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import pytest | ||
from pymchelper.input_output import frompattern | ||
|
||
|
||
@pytest.fixture | ||
def shieldhit_pattern() -> str: | ||
"""Fixture for SHIELD-HIT file pattern""" | ||
return "tests/res/shieldhit/generated/many/msh/aen_*.bdo" | ||
|
||
|
||
def test_estimators_are_sorted_by_names(shieldhit_pattern: str) -> None: | ||
"""Test if frompattern returns estimators sorted by name""" | ||
averaged_estimators = frompattern(pattern=shieldhit_pattern) | ||
estimator_names = [estimator.file_corename for estimator in averaged_estimators] | ||
assert estimator_names == sorted(estimator_names), "Estimators are not sorted by file names" |