Commit a5bd066b authored by Valentin Valls's avatar Valentin Valls
Browse files

Test reuse of custom plots

parent 1b74c317
Pipeline #38722 failed with stages
in 85 minutes and 17 seconds
"""Testing custom plots provided by Flint.""" """Testing custom plots provided by Flint."""
import gevent import gevent
import numpy
from bliss.common import plot from bliss.common import plot
from bliss.controllers.lima import roi as lima_roi from bliss.controllers.lima import roi as lima_roi
def test_reuse_custom_plot__api_1_0(flint_session):
"""Test reuse of custom plot from an ID"""
widget = plot.plot_curve(name="foo")
cos_data = numpy.cos(numpy.linspace(0, 2 * numpy.pi, 10))
widget.add_data({"cos": cos_data, "foo": cos_data})
widget2 = plot.plot_curve(name="foo", existing_id=widget.plot_id)
cos = widget2.get_data()["cos"]
numpy.testing.assert_allclose(cos, cos_data)
def test_reuse_custom_plot__api_1_6(flint_session):
"""Test reuse of custom plot from a name"""
widget = plot.plot_curve(name="foo", existing_id="myplot")
cos_data = numpy.cos(numpy.linspace(0, 2 * numpy.pi, 10))
widget.add_data({"cos": cos_data, "foo": cos_data})
widget2 = plot.plot_curve(name="foo", existing_id="myplot")
cos = widget2.get_data()["cos"]
numpy.testing.assert_allclose(cos, cos_data)
def test_select_points(flint_session): def test_select_points(flint_session):
flint = plot.get_flint() flint = plot.get_flint()
p = plot.plot() p = plot.plot()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment