From 17c05f5d8ffe2fe32bbe7dd19b796301407cb60f Mon Sep 17 00:00:00 2001 From: stalbe_j Date: Tue, 17 Jan 2023 09:18:41 +0100 Subject: [PATCH] tests:test_on_make_new_plot --- tests/test_mainwin.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/test_mainwin.py b/tests/test_mainwin.py index c7ec053..8af1175 100644 --- a/tests/test_mainwin.py +++ b/tests/test_mainwin.py @@ -12,7 +12,8 @@ from grum.dictlist.dictlistitem import DictListItem from grum.plotdesc import PlotDescription from grum.menus.rclickmenu import RClickMenu from grum.menus import BarMenu -from grum.mdi import MDIArea +from grum.mdi import MDIArea, MDISubMultiPlot, MDISubPlot + from grum.rpc import RPCServerThread from PyQt5.QtTest import QSignalSpy from grum.cli import main @@ -105,3 +106,14 @@ class TestViewUnit(unittest.TestCase): item.value.append.assert_called_once_with(point) assert item.set_alarm.called_once_with(True) + def test_on_make_new_plot(self): + mw = self.mw + + mw.make_subwin = mock.MagicMock() + + args = (1,2,'name') + kwargs = {'title':'plot_title'} + + mw.on_make_new_plot(args, kwargs) + + mw.make_subwin.assert_called_once_with(MDISubPlot,args, kwargs) \ No newline at end of file