def test_hide_login(): """ Ensure the login dialog is closed and hidden. """ mock_controller = mock.MagicMock() w = Window() w.setup(mock_controller) ld = mock.MagicMock() w.login_dialog = ld w.hide_login() ld.accept.assert_called_once_with() assert w.login_dialog is None
def test_hide_login(mocker): """ Ensure the login dialog is closed and hidden. """ w = Window() w.show_login = mocker.MagicMock() ld = mocker.MagicMock() w.login_dialog = ld w.hide_login() ld.accept.assert_called_once_with() assert w.login_dialog is None