summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMiguel Jacq <mig@mig5.net>2019-03-25 15:28:31 +1100
committerMiguel Jacq <mig@mig5.net>2019-03-25 15:28:31 +1100
commitee3a14a0253b409ad58c289cea788333cda93d37 (patch)
tree6e9b8bfea44846914b9bdc96aea15eb9be77dcdb /tests
parentc411e8d61a952faca758673a5c59133986fd9623 (diff)
downloadonionshare-ee3a14a0253b409ad58c289cea788333cda93d37.tar.gz
onionshare-ee3a14a0253b409ad58c289cea788333cda93d37.zip
Standardise all startup_timer, scheduled_start attributes as 'autostart_timer'
Diffstat (limited to 'tests')
-rw-r--r--tests/GuiBaseTest.py16
-rw-r--r--tests/GuiShareTest.py10
-rw-r--r--tests/local_onionshare_share_mode_autostart_and_autostop_timer_mismatch_test.py4
-rw-r--r--tests/local_onionshare_share_mode_autostart_timer_test.py (renamed from tests/local_onionshare_share_mode_startup_timer_test.py)6
-rw-r--r--tests/local_onionshare_share_mode_autostart_timer_too_short_test.py6
-rw-r--r--tests/local_onionshare_share_mode_cancel_share_test.py2
-rw-r--r--tests/onionshare_share_mode_cancel_share_test.py2
-rw-r--r--tests/test_onionshare_settings.py2
8 files changed, 24 insertions, 24 deletions
diff --git a/tests/GuiBaseTest.py b/tests/GuiBaseTest.py
index ec8dc870..d3fc9945 100644
--- a/tests/GuiBaseTest.py
+++ b/tests/GuiBaseTest.py
@@ -308,16 +308,16 @@ class GuiBaseTest(object):
# We should have timed out now
self.assertEqual(mode.server_status.status, 0)
- # Startup timer tests
- def set_startup_timer(self, mode, timer):
+ # Auto-start timer tests
+ def set_autostart_timer(self, mode, timer):
'''Test that the timer can be set'''
schedule = QtCore.QDateTime.currentDateTime().addSecs(timer)
- mode.server_status.startup_timer.setDateTime(schedule)
- self.assertTrue(mode.server_status.startup_timer.dateTime(), schedule)
+ mode.server_status.autostart_timer_widget.setDateTime(schedule)
+ self.assertTrue(mode.server_status.autostart_timer_widget.dateTime(), schedule)
- def startup_timer_widget_hidden(self, mode):
- '''Test that the startup timer widget is hidden when share has started'''
- self.assertFalse(mode.server_status.startup_timer_container.isVisible())
+ def autostart_timer_widget_hidden(self, mode):
+ '''Test that the auto-start timer widget is hidden when share has started'''
+ self.assertFalse(mode.server_status.autostart_timer_container.isVisible())
def scheduled_service_started(self, mode, wait):
'''Test that the server has timed out after the timer ran out'''
@@ -331,7 +331,7 @@ class GuiBaseTest(object):
self.server_status_indicator_says_scheduled(mode)
self.add_delete_buttons_hidden()
self.settings_button_is_hidden()
- self.set_startup_timer(mode, 10)
+ self.set_autostart_timer(mode, 10)
QtTest.QTest.mousePress(mode.server_status.server_button, QtCore.Qt.LeftButton)
QtTest.QTest.qWait(2000)
QtTest.QTest.mouseRelease(mode.server_status.server_button, QtCore.Qt.LeftButton)
diff --git a/tests/GuiShareTest.py b/tests/GuiShareTest.py
index d25c6c34..29661712 100644
--- a/tests/GuiShareTest.py
+++ b/tests/GuiShareTest.py
@@ -195,12 +195,12 @@ class GuiShareTest(GuiBaseTest):
self.server_timed_out(self.gui.share_mode, 10000)
self.web_server_is_stopped()
- def run_all_share_mode_startup_timer_tests(self, public_mode):
- """Auto-stop timer tests in share mode"""
+ def run_all_share_mode_autostart_timer_tests(self, public_mode):
+ """Auto-start timer tests in share mode"""
self.run_all_share_mode_setup_tests()
- self.set_startup_timer(self.gui.share_mode, 5)
+ self.set_autostart_timer(self.gui.share_mode, 5)
self.server_working_on_start_button_pressed(self.gui.share_mode)
- self.startup_timer_widget_hidden(self.gui.share_mode)
+ self.autostart_timer_widget_hidden(self.gui.share_mode)
self.server_status_indicator_says_scheduled(self.gui.share_mode)
self.web_server_is_stopped()
self.scheduled_service_started(self.gui.share_mode, 7000)
@@ -209,7 +209,7 @@ class GuiShareTest(GuiBaseTest):
def run_all_share_mode_autostop_autostart_mismatch_tests(self, public_mode):
"""Auto-stop timer tests in share mode"""
self.run_all_share_mode_setup_tests()
- self.set_startup_timer(self.gui.share_mode, 15)
+ self.set_autostart_timer(self.gui.share_mode, 15)
self.set_timeout(self.gui.share_mode, 5)
QtCore.QTimer.singleShot(4000, self.accept_dialog)
QtTest.QTest.mouseClick(self.gui.share_mode.server_status.server_button, QtCore.Qt.LeftButton)
diff --git a/tests/local_onionshare_share_mode_autostart_and_autostop_timer_mismatch_test.py b/tests/local_onionshare_share_mode_autostart_and_autostop_timer_mismatch_test.py
index 2017e58d..70a9ecb3 100644
--- a/tests/local_onionshare_share_mode_autostart_and_autostop_timer_mismatch_test.py
+++ b/tests/local_onionshare_share_mode_autostart_and_autostop_timer_mismatch_test.py
@@ -4,12 +4,12 @@ import unittest
from .GuiShareTest import GuiShareTest
-class LocalShareModeStartupTimerTest(unittest.TestCase, GuiShareTest):
+class LocalShareModeAutoStartTimerTest(unittest.TestCase, GuiShareTest):
@classmethod
def setUpClass(cls):
test_settings = {
"public_mode": False,
- "startup_timer": True,
+ "autostart_timer": True,
"autostop_timer": True,
}
cls.gui = GuiShareTest.set_up(test_settings)
diff --git a/tests/local_onionshare_share_mode_startup_timer_test.py b/tests/local_onionshare_share_mode_autostart_timer_test.py
index b5e08b10..9da75f1d 100644
--- a/tests/local_onionshare_share_mode_startup_timer_test.py
+++ b/tests/local_onionshare_share_mode_autostart_timer_test.py
@@ -4,12 +4,12 @@ import unittest
from .GuiShareTest import GuiShareTest
-class LocalShareModeStartupTimerTest(unittest.TestCase, GuiShareTest):
+class LocalShareModeAutoStartTimerTest(unittest.TestCase, GuiShareTest):
@classmethod
def setUpClass(cls):
test_settings = {
"public_mode": False,
- "startup_timer": True,
+ "autostart_timer": True,
}
cls.gui = GuiShareTest.set_up(test_settings)
@@ -20,7 +20,7 @@ class LocalShareModeStartupTimerTest(unittest.TestCase, GuiShareTest):
@pytest.mark.gui
def test_gui(self):
self.run_all_common_setup_tests()
- self.run_all_share_mode_startup_timer_tests(False)
+ self.run_all_share_mode_autostart_timer_tests(False)
if __name__ == "__main__":
unittest.main()
diff --git a/tests/local_onionshare_share_mode_autostart_timer_too_short_test.py b/tests/local_onionshare_share_mode_autostart_timer_too_short_test.py
index 12343478..92bbe12d 100644
--- a/tests/local_onionshare_share_mode_autostart_timer_too_short_test.py
+++ b/tests/local_onionshare_share_mode_autostart_timer_too_short_test.py
@@ -5,12 +5,12 @@ from PyQt5 import QtCore, QtTest
from .GuiShareTest import GuiShareTest
-class LocalShareModeStartupTimerTooShortTest(unittest.TestCase, GuiShareTest):
+class LocalShareModeAutoStartTimerTooShortTest(unittest.TestCase, GuiShareTest):
@classmethod
def setUpClass(cls):
test_settings = {
"public_mode": False,
- "startup_timer": True,
+ "autostart_timer": True,
}
cls.gui = GuiShareTest.set_up(test_settings)
@@ -23,7 +23,7 @@ class LocalShareModeStartupTimerTooShortTest(unittest.TestCase, GuiShareTest):
self.run_all_common_setup_tests()
self.run_all_share_mode_setup_tests()
# Set a low timeout
- self.set_startup_timer(self.gui.share_mode, 2)
+ self.set_autostart_timer(self.gui.share_mode, 2)
QtTest.QTest.qWait(3000)
QtCore.QTimer.singleShot(4000, self.accept_dialog)
QtTest.QTest.mouseClick(self.gui.share_mode.server_status.server_button, QtCore.Qt.LeftButton)
diff --git a/tests/local_onionshare_share_mode_cancel_share_test.py b/tests/local_onionshare_share_mode_cancel_share_test.py
index 24408730..ba52721d 100644
--- a/tests/local_onionshare_share_mode_cancel_share_test.py
+++ b/tests/local_onionshare_share_mode_cancel_share_test.py
@@ -8,7 +8,7 @@ class LocalShareModeCancelTest(unittest.TestCase, GuiShareTest):
@classmethod
def setUpClass(cls):
test_settings = {
- "startup_timer": True,
+ "autostart_timer": True,
}
cls.gui = GuiShareTest.set_up(test_settings)
diff --git a/tests/onionshare_share_mode_cancel_share_test.py b/tests/onionshare_share_mode_cancel_share_test.py
index ed087a2c..3fc4f592 100644
--- a/tests/onionshare_share_mode_cancel_share_test.py
+++ b/tests/onionshare_share_mode_cancel_share_test.py
@@ -8,7 +8,7 @@ class ShareModeCancelTest(unittest.TestCase, TorGuiShareTest):
@classmethod
def setUpClass(cls):
test_settings = {
- "startup_timer": True,
+ "autostart_timer": True,
}
cls.gui = TorGuiShareTest.set_up(test_settings)
diff --git a/tests/test_onionshare_settings.py b/tests/test_onionshare_settings.py
index 40eb9a0f..bcc2f7cb 100644
--- a/tests/test_onionshare_settings.py
+++ b/tests/test_onionshare_settings.py
@@ -52,7 +52,7 @@ class TestSettings:
'auth_password': '',
'close_after_first_download': True,
'autostop_timer': False,
- 'startup_timer': False,
+ 'autostart_timer': False,
'use_stealth': False,
'use_autoupdate': True,
'autoupdate_timestamp': None,