Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

test_dataladcmd_ui.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. from PySide6.QtWidgets import (
  2. QDialogButtonBox,
  3. QPushButton
  4. )
  5. from PySide6.QtCore import Qt
  6. from ..dataladcmd_ui import GooeyDataladCmdUI
  7. from datalad.tests.utils_pytest import (
  8. assert_equal,
  9. assert_false,
  10. assert_in,
  11. assert_is_not_none,
  12. assert_true,
  13. )
  14. def test_GooeyDataladCmdUI(gooey_app, *, qtbot):
  15. qtbot.addWidget(gooey_app.main_window)
  16. cmdui = GooeyDataladCmdUI(gooey_app, gooey_app.get_widget('cmdTab'))
  17. cmdui.configure({}, 'wtf', {})
  18. # command tab is set up:
  19. assert_true(cmdui.pwidget.isEnabled())
  20. assert_equal(
  21. gooey_app.get_widget('contextTabs').currentWidget().objectName(),
  22. "cmdTab")
  23. assert_equal(cmdui._cmd_title.text().lower(), "wtf")
  24. # click OK and see the correct signal:
  25. buttonbox = cmdui.pwidget.findChild(QDialogButtonBox, 'cmdTabButtonBox')
  26. ok_button = buttonbox.button(QDialogButtonBox.StandardButton.Ok)
  27. assert_is_not_none(ok_button)
  28. with qtbot.waitSignal(cmdui.configured_dataladcmd) as blocker:
  29. qtbot.mouseClick(ok_button, Qt.LeftButton)
  30. assert_equal(blocker.args[0], 'wtf')
  31. assert_in("decor", blocker.args[1].keys())
  32. # reset_form
  33. cmdui.reset_form()
  34. assert_equal(cmdui._cmd_title.text().lower(), "")
  35. assert_false(cmdui.pwidget.isEnabled())