Exemplo n.º 1
0
def test_show_main_window_without_username(mocker):
    w = Window()
    w.autosize_window = mocker.MagicMock()
    w.show = mocker.MagicMock()
    w.set_logged_in_as = mocker.MagicMock()

    w.show_main_window()

    w.autosize_window.assert_called_once_with()
    w.show.assert_called_once_with()
    w.set_logged_in_as.called is False
Exemplo n.º 2
0
def test_show_main_window(mocker):
    w = Window()
    w.autosize_window = mocker.MagicMock()
    w.show = mocker.MagicMock()
    w.set_logged_in_as = mocker.MagicMock()

    w.show_main_window(username='******')

    w.autosize_window.assert_called_once_with()
    w.show.assert_called_once_with()
    w.set_logged_in_as.assert_called_once_with('test_username')