Пример #1
0
    def test_destroy_all(self):
        num = 0
        self.add_manager(num)

        other_mock_fig = Mock()
        other_mock_manager = MockFigureManager(num + 1)
        other_mock_manager.canvas.figure = other_mock_fig
        GlobalFigureManager.set_active(other_mock_manager)

        self.assertEqual(2, len(GlobalFigureManager._activeQue))
        self.assertEqual(2, len(GlobalFigureManager.figs))

        GlobalFigureManager.destroy_all()
        self.assertEqual(0, len(GlobalFigureManager._activeQue))
        self.assertEqual(0, len(GlobalFigureManager.figs))
    def test_destroy_all(self):
        num = 0
        self.add_manager(num)

        other_mock_fig = Mock()
        other_mock_manager = MockFigureManager(num + 1)
        other_mock_manager.canvas.figure = other_mock_fig
        GlobalFigureManager.set_active(other_mock_manager)

        self.assertEqual(2, len(GlobalFigureManager._activeQue))
        self.assertEqual(2, len(GlobalFigureManager.figs))

        GlobalFigureManager.destroy_all()
        self.assertEqual(0, len(GlobalFigureManager._activeQue))
        self.assertEqual(0, len(GlobalFigureManager.figs))
Пример #3
0
 def setUp(self):
     # reset the figure manager before each test
     GlobalFigureManager.destroy_all()
 def setUp(self):
     # reset the figure manager before each test
     GlobalFigureManager.destroy_all()