Live changes from early July, PX-III
This commit was merged in pull request #111.
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
# import sys
|
||||
# from unittest.mock import MagicMock, patch
|
||||
#
|
||||
# from aarecommon.models.beamline import MXBeamline
|
||||
# from aare.gui.gui import main
|
||||
#
|
||||
#
|
||||
# @patch("aare.gui.gui.sys.exit")
|
||||
# @patch("aare.gui.gui.cfg_get")
|
||||
# @patch("aare.gui.gui.mx_beamline")
|
||||
# @patch("aare.gui.gui.auth")
|
||||
# @patch("aare.gui.gui.MainWindow")
|
||||
# @patch("aare.gui.gui.LoadingSplashScreen")
|
||||
# @patch("aare.gui.gui.QtGui.QPixmap")
|
||||
# @patch("aare.gui.gui.QtGui.QIcon")
|
||||
# @patch("aare.gui.gui.QApplication")
|
||||
# def test_gui_main_startup(
|
||||
# mock_app,
|
||||
# mock_qicon,
|
||||
# mock_qpixmap,
|
||||
# mock_splash_cls,
|
||||
# mock_main_window,
|
||||
# mock_auth,
|
||||
# mock_mx_beamline,
|
||||
# mock_cfg_get,
|
||||
# mock_sys_exit,
|
||||
# ):
|
||||
# mock_mx_beamline.return_value = MXBeamline.X06DA
|
||||
# mock_auth.return_value = "header.payload.signature"
|
||||
# mock_cfg_get.side_effect = lambda key, default=None: default
|
||||
#
|
||||
# mock_app_instance = mock_app.return_value
|
||||
# mock_app_instance.exec.return_value = 0
|
||||
#
|
||||
# mock_splash = mock_splash_cls.return_value
|
||||
# mock_window = mock_main_window.return_value
|
||||
#
|
||||
# with patch.object(sys, "argv", ["gui.py"]):
|
||||
# main()
|
||||
#
|
||||
# mock_app.assert_called_once_with(["gui.py"])
|
||||
# mock_auth.assert_called_once()
|
||||
# mock_main_window.assert_called_once()
|
||||
# mock_window.show.assert_called_once()
|
||||
#
|
||||
# mock_splash.show.assert_called_once()
|
||||
# mock_splash.finish.assert_called_once_with(mock_window)
|
||||
#
|
||||
# mock_sys_exit.assert_called_once_with(0)
|
||||
@@ -7,6 +7,7 @@ from aare.gui.widgets.message_box import (
|
||||
experiment_hutch_shutter_check,
|
||||
ring_current_auto_check,
|
||||
)
|
||||
import pytest
|
||||
|
||||
|
||||
def test_reply_box(qtbot):
|
||||
@@ -30,10 +31,10 @@ def test_timer_box_auto_accept(qtbot):
|
||||
|
||||
assert box.result() == QMessageBox.StandardButton.Yes
|
||||
|
||||
|
||||
@pytest.mark.timeout(10)
|
||||
def test_ring_current_low_check_ok(qtbot):
|
||||
# Should return True immediately if current is high enough
|
||||
assert ring_current_low_check(None, 200.0) is True
|
||||
assert ring_current_low_check(None, 361.0) is True
|
||||
|
||||
|
||||
def test_ring_current_low_check_low_yes(qtbot):
|
||||
|
||||
Reference in New Issue
Block a user