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.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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_true,
  12. with_tempfile,
  13. )
  14. from .utils import gooey_app
  15. @with_tempfile(mkdir=True)
  16. def test_GooeyDataladCmdUI(rootpath=None, *, qtbot):
  17. with gooey_app(rootpath) as gooey:
  18. qtbot.addWidget(gooey.main_window)
  19. cmdui = GooeyDataladCmdUI(gooey, gooey.get_widget('cmdTab'))
  20. cmdui.configure('wtf', {})
  21. # command tab is set up:
  22. assert_true(cmdui.pwidget.isEnabled())
  23. assert_equal(gooey.get_widget('contextTabs').currentWidget().objectName(),
  24. "cmdTab")
  25. assert_equal(cmdui._cmd_title.text().lower(), "wtf")
  26. # click OK and see the correct signal:
  27. buttonbox = cmdui.pwidget.findChild(QDialogButtonBox, 'cmdTabButtonBox')
  28. ok_button = [b for b in buttonbox.findChildren(QPushButton)
  29. if b.text() == "OK"]
  30. assert_equal(len(ok_button), 1)
  31. ok_button = ok_button[0]
  32. with qtbot.waitSignal(cmdui.configured_dataladcmd) as blocker:
  33. qtbot.mouseClick(ok_button, Qt.LeftButton)
  34. assert_equal(blocker.args[0], 'wtf')
  35. assert_in("decor", blocker.args[1].keys())
  36. # reset_form
  37. cmdui.reset_form()
  38. assert_equal(cmdui._cmd_title.text().lower(), "")
  39. assert_false(cmdui.pwidget.isEnabled())