Skip to content

Commit 8010268

Browse files
be-smithml-evs
authored andcommitted
Added .rasx file to tests and made sure tests only run on files with the accepted extensions for xrd block
1 parent aa1237c commit 8010268

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed
Binary file not shown.

pydatalab/tests/apps/test_xrd_block.py

+14-12
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,21 @@ def data_files():
1313

1414
def test_load(data_files):
1515
for f in data_files:
16-
df, y_options = XRDBlock.load_pattern(f)
17-
assert all(y in df.columns for y in y_options)
16+
if f.suffix in XRDBlock.accepted_file_extensions:
17+
df, y_options = XRDBlock.load_pattern(f)
18+
assert all(y in df.columns for y in y_options)
1819

1920

2021
def test_plot(data_files):
2122
f = next(data_files)
22-
df, y_options = XRDBlock.load_pattern(f)
23-
p = selectable_axes_plot(
24-
[df],
25-
x_options=["2θ (°)", "Q (Å⁻¹)", "d (Å)"],
26-
y_options=y_options,
27-
plot_line=True,
28-
plot_points=True,
29-
point_size=3,
30-
)
31-
assert p
23+
if f.suffix in XRDBlock.accepted_file_extensions:
24+
df, y_options = XRDBlock.load_pattern(f)
25+
p = selectable_axes_plot(
26+
[df],
27+
x_options=["2θ (°)", "Q (Å⁻¹)", "d (Å)"],
28+
y_options=y_options,
29+
plot_line=True,
30+
plot_points=True,
31+
point_size=3,
32+
)
33+
assert p

0 commit comments

Comments
 (0)