test: create test_plotdesc
This commit is contained in:
32
tests/test_plotdesc.py
Normal file
32
tests/test_plotdesc.py
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
from grum.plotdesc import PlotDescription
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
"plot_name, plot_title, plot_xlabel, plot_ylabel, xs,ys", [('plot_name',
|
||||||
|
'plot_title',
|
||||||
|
'plot_xlabel',
|
||||||
|
'plot_ylabel',
|
||||||
|
[1, 2],
|
||||||
|
[3, 4]),
|
||||||
|
('plot_name',
|
||||||
|
None,
|
||||||
|
None,
|
||||||
|
None,
|
||||||
|
[],
|
||||||
|
[])]
|
||||||
|
)
|
||||||
|
def test_plot_derscription_init(plot_name, plot_title, plot_xlabel, plot_ylabel, xs, ys):
|
||||||
|
|
||||||
|
if plot_title:
|
||||||
|
pd = PlotDescription(plot_name, plot_title,
|
||||||
|
plot_xlabel, plot_ylabel, xs, ys)
|
||||||
|
else:
|
||||||
|
pd = PlotDescription(plot_name)
|
||||||
|
|
||||||
|
assert pd.name == plot_name
|
||||||
|
assert pd.title == plot_title
|
||||||
|
assert pd.xlabel == plot_xlabel
|
||||||
|
assert pd.ylabel == plot_ylabel
|
||||||
|
assert pd.xs == xs
|
||||||
|
assert pd.ys == ys
|
||||||
|
|
Reference in New Issue
Block a user