Esempio n. 1
0
 def test_figure_title_changed(self):
     mock_figure_number = 312312
     with patch.object(GlobalFigureManager,
                       'notify_observers',
                       return_value=False) as mock_notify_observers:
         GlobalFigureManager.figure_title_changed(mock_figure_number)
         mock_notify_observers.assert_called_once_with(
             FigureAction.Renamed, mock_figure_number)
Esempio n. 2
0
    def set_window_title(self, title):
        self.window.setWindowTitle(title)
        # We need to add a call to the figure manager here to call
        # notify methods when a figure is renamed, to update our
        # plot list.
        GlobalFigureManager.figure_title_changed(self.num)

        # For the workbench we also keep the label in sync, this is
        # to allow getting a handle as plt.figure('Figure Name')
        self.canvas.figure.set_label(title)
 def test_figure_title_changed(self):
     mock_figure_number = 312312
     with patch.object(GlobalFigureManager, 'notify_observers', return_value=False) as mock_notify_observers:
         GlobalFigureManager.figure_title_changed(mock_figure_number)
         mock_notify_observers.assert_called_once_with(FigureAction.Renamed, mock_figure_number)