mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
feat: added config plotter
This commit is contained in:
45
tests/test_config_plotter.py
Normal file
45
tests/test_config_plotter.py
Normal file
@ -0,0 +1,45 @@
|
||||
import pyqtgraph as pg
|
||||
from pytestqt import qtbot
|
||||
|
||||
from bec_widgets import config_plotter
|
||||
|
||||
|
||||
def test_config_plotter(qtbot):
|
||||
"""Test ConfigPlotter"""
|
||||
|
||||
config = [
|
||||
{
|
||||
"cols": 1,
|
||||
"rows": 1,
|
||||
"y": 0,
|
||||
"x": 0,
|
||||
"config": {"channels": ["a"], "label_xy": ["", "a"], "item": "PlotItem"},
|
||||
}
|
||||
]
|
||||
plotter = config_plotter.ConfigPlotter(config)
|
||||
|
||||
assert isinstance(plotter.plots["a"]["item"], pg.PlotItem)
|
||||
|
||||
|
||||
def test_config_plotter_image(qtbot):
|
||||
"""Test ConfigPlotter"""
|
||||
|
||||
config = [
|
||||
{
|
||||
"cols": 1,
|
||||
"rows": 1,
|
||||
"y": 0,
|
||||
"x": 0,
|
||||
"config": {"channels": ["a"], "label_xy": ["", "a"], "item": "PlotItem"},
|
||||
},
|
||||
{
|
||||
"cols": 1,
|
||||
"rows": 1,
|
||||
"y": 1,
|
||||
"x": 0,
|
||||
"config": {"channels": ["b"], "label_xy": ["", "b"], "item": "ImageItem"},
|
||||
},
|
||||
]
|
||||
plotter = config_plotter.ConfigPlotter(config)
|
||||
|
||||
assert isinstance(plotter.plots["a"]["item"], pg.PlotItem)
|
Reference in New Issue
Block a user