diff --git a/tests/test_main_window.py b/tests/test_main_window.py deleted file mode 100644 index 29a8d439..00000000 --- a/tests/test_main_window.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (C) 2017 GNS3 Technologies Inc. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -from unittest.mock import patch -from gns3.main_window import MainWindow - - -def test_new_project_when_dialog_is_already_available(): - main_window = MainWindow() - with patch('gns3.main_window.ProjectDialog') as project_dialog_mock, \ - patch('gns3.topology.Topology.createLoadProject') as load_project_mock: - - main_window._project_dialog = project_dialog_mock() - - project_dialog_mock().exec_.return_value = 1 - project_dialog_mock().getProjectSettings.side_effect = AttributeError("Mocked") - main_window._newProjectActionSlot() - - # load is not called when we handle the case - assert load_project_mock.called is False diff --git a/tests/utils/test_server_select.py b/tests/utils/test_server_select.py index d619f937..7f72dedb 100644 --- a/tests/utils/test_server_select.py +++ b/tests/utils/test_server_select.py @@ -38,11 +38,11 @@ def test_server_select_local_server_local_disallow(main_window, local_server): With only local server we don't show the list of server """ - with patch("gns3.qt.QtWidgets.QInputDialog.getItem") as mock: - server = server_select(main_window, allow_local_server=False) - - assert not mock.called - assert server is None + with patch("gns3.qt.QtWidgets.QMessageBox.critical"): + with patch("gns3.qt.QtWidgets.QInputDialog.getItem") as mock: + server = server_select(main_window, allow_local_server=False) + assert not mock.called + assert server is None def test_server_select_local_server_and_remote_select_local(main_window, remote_server, local_server):