def test_draw_all_some_stale(self): mock_managers = self.setup_draw_all(stale=True) stale_id = 1 mock_managers[stale_id].canvas.figure.stale = False GlobalFigureManager.draw_all() for i in range(len(mock_managers)): manager = mock_managers[i] if i != stale_id: manager.canvas.draw_idle.assert_called_once_with() else: self.assertNotCalled(manager.canvas.draw_idle)
def test_draw_all_some_stale(self): mock_managers = self.setup_draw_all(stale=True) stale_id = 1 mock_managers[stale_id].canvas.figure.stale = False GlobalFigureManager.draw_all() for i in range(len(mock_managers)): manager = mock_managers[i] if i != stale_id: manager.canvas.draw_idle.assert_called_once_with() else: self.assertNotCalled(manager.canvas.draw_idle)
def test_draw_all_force(self): mock_managers = self.setup_draw_all(stale=False) GlobalFigureManager.draw_all(force=True) for manager in mock_managers: manager.canvas.draw_idle.assert_called_once_with()
def test_draw_all_do_not_draw_non_stale(self): mock_managers = self.setup_draw_all(stale=False) GlobalFigureManager.draw_all() for manager in mock_managers: self.assertNotCalled(manager.canvas.draw_idle)
def test_draw_all_force(self): mock_managers = self.setup_draw_all(stale=False) GlobalFigureManager.draw_all(force=True) for manager in mock_managers: manager.canvas.draw_idle.assert_called_once_with()
def test_draw_all_do_not_draw_non_stale(self): mock_managers = self.setup_draw_all(stale=False) GlobalFigureManager.draw_all() for manager in mock_managers: self.assertNotCalled(manager.canvas.draw_idle)