Esempio n. 1
0
    def test_notify_clear(self):
        mock_figure_manager = MockGlobalFigureManager()
        observer = GlobalFigureManagerObserver(mock_figure_manager)
        key = 12313
        observer.notify(DictionaryAction.Clear, key)

        mock_figure_manager.figs.keys.assert_called_once_with()
    def test_notify_clear(self):
        mock_figure_manager = MockGlobalFigureManager()
        observer = GlobalFigureManagerObserver(mock_figure_manager)
        key = 12313
        observer.notify(DictionaryAction.Clear, key)

        mock_figure_manager.figs.keys.assert_called_once_with()
Esempio n. 3
0
    def test_notify_update(self):
        mock_figure_manager = MockGlobalFigureManager()
        observer = GlobalFigureManagerObserver(mock_figure_manager)
        key = 12313
        observer.notify(DictionaryAction.Update, key)

        mock_figure_manager.notify_observers.assert_called_once_with(FigureAction.Update, key)
    def test_notify_update(self):
        mock_figure_manager = MockGlobalFigureManager()
        observer = GlobalFigureManagerObserver(mock_figure_manager)
        key = 12313
        observer.notify(DictionaryAction.Update, key)

        mock_figure_manager.notify_observers.assert_called_once_with(FigureAction.Update, key)
Esempio n. 5
0
 def test_raises_on_invalid_action(self):
     mock_figure_manager = MockGlobalFigureManager()
     observer = GlobalFigureManagerObserver(mock_figure_manager)
     key = 12313
     self.assertRaises(ValueError, observer.notify, 941949, key)