Пример #1
0
def test_update_error_status_default(mocker):
    """
    Ensure that the error to be shown in the error status bar will be passed to the top pane with a
    default duration of 10 seconds.
    """
    w = Window()
    w.top_pane = mocker.MagicMock()
    w.update_error_status(message='test error message')
    w.top_pane.update_error_status.assert_called_once_with('test error message', 10000)
Пример #2
0
def test_update_error_status(mocker):
    """
    Ensure that the error to be shown in the error status bar will be passed to the top pane with
    the duration of seconds provided.
    """
    w = Window()
    w.top_pane = mocker.MagicMock()
    w.update_error_status(message='test error message', duration=123)
    w.top_pane.update_error_status.assert_called_once_with('test error message', 123)
Пример #3
0
def test_update_error_status():
    """
    Ensure that the error to be shown in the error status sidebar will
    be passed to the left sidebar for display.
    """
    error_message = "this is a bad thing!"
    w = Window()
    w.main_view = mock.MagicMock()
    w.update_error_status(error=error_message)
    w.main_view.update_error_status.assert_called_once_with(error_message)