Skip to content

Commit dfb7674

Browse files
tests: Added printing fpath when pattern get_data fails
1 parent ba07fab commit dfb7674

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/t_download.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from holytools.devtools import Unittest
55

66
from opxrd import OpXRD
7+
from xrdpattern.pattern import XrdPattern
78

89

910
class TestLoading(Unittest):
@@ -16,8 +17,18 @@ def test_dl(self):
1617
if self.is_manual_mode:
1718
opxrd.plot_quantity(attr='primary_phase.spacegroup')
1819

19-
for p in opxrd.patterns:
20+
21+
for fpath, patterns in opxrd.fpath_dict.items():
22+
for p in patterns:
23+
self.check_pattern_data(fpath,p)
24+
25+
@staticmethod
26+
def check_pattern_data(fpath: str, p: XrdPattern):
27+
try:
2028
p.get_pattern_data()
29+
except Exception as e:
30+
print(f'Retriving pattern data failed for pattern at fpath = {fpath}')
31+
raise e
2132

2233
if __name__ == "__main__":
2334
TestLoading.execute_all()

0 commit comments

Comments
 (0)