mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-26 07:49:48 -05:00
Added test_autostart_timer_too_short
This commit is contained in:
parent
09104c6a67
commit
08298d9ffd
@ -391,3 +391,26 @@ class TestShare(GuiBaseTest):
|
||||
self.web_server_is_stopped(tab)
|
||||
|
||||
self.close_all_tabs()
|
||||
|
||||
@pytest.mark.gui
|
||||
def test_autostart_timer_too_short(self):
|
||||
"""
|
||||
Autostart timer should throw a warning if the scheduled time is too soon
|
||||
"""
|
||||
tab = self.new_share_tab()
|
||||
tab.get_mode().mode_settings_widget.toggle_advanced_button.click()
|
||||
tab.get_mode().mode_settings_widget.autostart_timer_checkbox.click()
|
||||
|
||||
def accept_dialog():
|
||||
window = tab.common.gui.qtapp.activeWindow()
|
||||
if window:
|
||||
window.close()
|
||||
|
||||
self.run_all_common_setup_tests()
|
||||
self.run_all_share_mode_setup_tests(tab)
|
||||
# Set a low timeout
|
||||
self.set_autostart_timer(tab, 2)
|
||||
QtTest.QTest.qWait(2200)
|
||||
QtCore.QTimer.singleShot(200, accept_dialog)
|
||||
tab.get_mode().server_status.server_button.click()
|
||||
self.assertEqual(tab.get_mode().server_status.status, 0)
|
||||
|
Loading…
Reference in New Issue
Block a user