mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 11:33:42 +02:00
Impr/refactor find files (#153)
* wrote small test for ms5_xsf read method * small bug in ms5_xsf found * first version of refactoring with test * built _find_files into openQCD module * postfix can now be used as before * altered test data to be smaller * read_rwms throws better Exception now * typo corrected * better tests for postfixes, also added similar solution for ext variable * added method to sort names of files and replica better
This commit is contained in:
parent
ee74ec4ed7
commit
0bc08be634
2 changed files with 44 additions and 2 deletions
|
@ -165,3 +165,11 @@ def test_find_files():
|
|||
fpre = "tune62"
|
||||
with pytest.raises(Exception):
|
||||
pe.input.openQCD._find_files(path, fpre, "ms5_xsf_" + qc, "dat")
|
||||
|
||||
|
||||
def test_sort_names():
|
||||
my_list = ['sfqcd_r1_id5', 'sfqcd_r10_id5', 'sfqcd_r7_id5', 'sfqcd_r2_id5', 'sfqcd_r2_id9', 'sfqcd_r10_id4']
|
||||
presorted_list = ['sfqcd_r1_id5', 'sfqcd_r2_id5', 'sfqcd_r2_id9', 'sfqcd_r7_id5', 'sfqcd_r10_id4', 'sfqcd_r10_id5']
|
||||
|
||||
sorted_list = pe.input.openQCD._sort_names(my_list)
|
||||
assert (all([sorted_list[i] == presorted_list[i] for i in range(len(sorted_list))]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue