Skip to content

Commit

Permalink
added another test
Browse files Browse the repository at this point in the history
  • Loading branch information
JoschD committed Sep 1, 2023
1 parent 2ea7042 commit be0fe6a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/unit/test_plot_optics_measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,29 @@ def test_two_directories_combined(tmp_path):
assert len(figs) == 2


@pytest.mark.extended
def test_two_directories_combined_labels(tmp_path):
labels = ["label1", "label2"]
figs = plot(
show=False,
x_axis="phase-advance",
ncol_legend=2,
folders=[str(INPUT), str(INPUT.parent / "example_copy")],
labels=labels,
output=str(tmp_path),
optics_parameters=["orbit", "beta_phase"],
combine_by=["files"],
)
assert len(list(tmp_path.glob("*.pdf"))) == 2
assert len(figs) == 2
for fig in figs.values():
assert len(fig.axes) == 2
for ax in fig.axes:
axlabels = ax.get_legend_handles_labels()[1]
for label, axlabel in zip(labels, axlabels):
assert label in axlabel


@pytest.mark.extended
def test_beta_phase(tmp_path):
_default_test("beta_phase", output_dir=tmp_path)
Expand Down

0 comments on commit be0fe6a

Please sign in to comment.