summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMiguel Jacq <mig@mig5.net>2019-03-25 15:05:54 +1100
committerMiguel Jacq <mig@mig5.net>2019-03-25 15:05:54 +1100
commitc411e8d61a952faca758673a5c59133986fd9623 (patch)
tree7687c654ab7cbf0e73464a932b49d4ecc0c22d6f /tests
parent49285e047c43d97bf9c87a00859ecf74685f9228 (diff)
downloadonionshare-c411e8d61a952faca758673a5c59133986fd9623.tar.gz
onionshare-c411e8d61a952faca758673a5c59133986fd9623.zip
Standardise all shutdown_timer, shutdown_timeout, timeout attributes as 'autostop_timer'
Diffstat (limited to 'tests')
-rw-r--r--tests/GuiBaseTest.py10
-rw-r--r--tests/GuiReceiveTest.py2
-rw-r--r--tests/GuiShareTest.py4
-rw-r--r--tests/SettingsGuiBaseTest.py12
-rw-r--r--tests/TorGuiShareTest.py2
-rw-r--r--tests/local_onionshare_receive_mode_timer_test.py2
-rw-r--r--tests/local_onionshare_share_mode_autostart_and_autostop_timer_mismatch_test.py (renamed from tests/local_onionshare_share_mode_startup_and_shutdown_timer_mismatch_test.py)4
-rw-r--r--tests/local_onionshare_share_mode_timer_test.py2
-rw-r--r--tests/local_onionshare_share_mode_timer_too_short_test.py2
-rw-r--r--tests/onionshare_share_mode_timer_test.py2
-rw-r--r--tests/test_onionshare_settings.py2
11 files changed, 22 insertions, 22 deletions
diff --git a/tests/GuiBaseTest.py b/tests/GuiBaseTest.py
index 9ff0477f..ec8dc870 100644
--- a/tests/GuiBaseTest.py
+++ b/tests/GuiBaseTest.py
@@ -294,12 +294,12 @@ class GuiBaseTest(object):
def set_timeout(self, mode, timeout):
'''Test that the timeout can be set'''
timer = QtCore.QDateTime.currentDateTime().addSecs(timeout)
- mode.server_status.shutdown_timeout.setDateTime(timer)
- self.assertTrue(mode.server_status.shutdown_timeout.dateTime(), timer)
+ mode.server_status.autostop_timer_widget.setDateTime(timer)
+ self.assertTrue(mode.server_status.autostop_timer_widget.dateTime(), timer)
- def timeout_widget_hidden(self, mode):
- '''Test that the timeout widget is hidden when share has started'''
- self.assertFalse(mode.server_status.shutdown_timeout_container.isVisible())
+ def autostop_timer_widget_hidden(self, mode):
+ '''Test that the auto-stop timer widget is hidden when share has started'''
+ self.assertFalse(mode.server_status.autostop_timer_container.isVisible())
def server_timed_out(self, mode, wait):
diff --git a/tests/GuiReceiveTest.py b/tests/GuiReceiveTest.py
index d1581c8e..40c3de95 100644
--- a/tests/GuiReceiveTest.py
+++ b/tests/GuiReceiveTest.py
@@ -139,6 +139,6 @@ class GuiReceiveTest(GuiBaseTest):
"""Auto-stop timer tests in receive mode"""
self.run_all_receive_mode_setup_tests(public_mode)
self.set_timeout(self.gui.receive_mode, 5)
- self.timeout_widget_hidden(self.gui.receive_mode)
+ self.autostop_timer_widget_hidden(self.gui.receive_mode)
self.server_timed_out(self.gui.receive_mode, 15000)
self.web_server_is_stopped()
diff --git a/tests/GuiShareTest.py b/tests/GuiShareTest.py
index e8b31451..d25c6c34 100644
--- a/tests/GuiShareTest.py
+++ b/tests/GuiShareTest.py
@@ -191,7 +191,7 @@ class GuiShareTest(GuiBaseTest):
self.run_all_share_mode_setup_tests()
self.set_timeout(self.gui.share_mode, 5)
self.run_all_share_mode_started_tests(public_mode)
- self.timeout_widget_hidden(self.gui.share_mode)
+ self.autostop_timer_widget_hidden(self.gui.share_mode)
self.server_timed_out(self.gui.share_mode, 10000)
self.web_server_is_stopped()
@@ -206,7 +206,7 @@ class GuiShareTest(GuiBaseTest):
self.scheduled_service_started(self.gui.share_mode, 7000)
self.web_server_is_running()
- def run_all_share_mode_startup_shutdown_mismatch_tests(self, public_mode):
+ 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)
diff --git a/tests/SettingsGuiBaseTest.py b/tests/SettingsGuiBaseTest.py
index 844a0c86..35bdd9c6 100644
--- a/tests/SettingsGuiBaseTest.py
+++ b/tests/SettingsGuiBaseTest.py
@@ -77,11 +77,11 @@ class SettingsGuiBaseTest(object):
QtTest.QTest.mouseClick(self.gui.public_mode_checkbox, QtCore.Qt.LeftButton, pos=QtCore.QPoint(2,self.gui.public_mode_checkbox.height()/2))
self.assertTrue(self.gui.public_mode_checkbox.isChecked())
- # shutdown timer is off
- self.assertFalse(self.gui.shutdown_timeout_checkbox.isChecked())
- # enable shutdown timer
- QtTest.QTest.mouseClick(self.gui.shutdown_timeout_checkbox, QtCore.Qt.LeftButton, pos=QtCore.QPoint(2,self.gui.shutdown_timeout_checkbox.height()/2))
- self.assertTrue(self.gui.shutdown_timeout_checkbox.isChecked())
+ # autostop timer is off
+ self.assertFalse(self.gui.autostop_timer_checkbox.isChecked())
+ # enable autostop timer
+ QtTest.QTest.mouseClick(self.gui.autostop_timer_checkbox, QtCore.Qt.LeftButton, pos=QtCore.QPoint(2,self.gui.autostop_timer_checkbox.height()/2))
+ self.assertTrue(self.gui.autostop_timer_checkbox.isChecked())
# legacy mode checkbox and related widgets
if self.gui.onion.is_authenticated():
@@ -222,7 +222,7 @@ class SettingsGuiBaseTest(object):
data = json.load(f)
self.assertTrue(data["public_mode"])
- self.assertTrue(data["shutdown_timeout"])
+ self.assertTrue(data["autostop_timer"])
if self.gui.onion.is_authenticated():
if self.gui.onion.supports_v3_onions:
diff --git a/tests/TorGuiShareTest.py b/tests/TorGuiShareTest.py
index 53641dce..36efacd1 100644
--- a/tests/TorGuiShareTest.py
+++ b/tests/TorGuiShareTest.py
@@ -89,7 +89,7 @@ class TorGuiShareTest(TorGuiBaseTest, GuiShareTest):
self.run_all_share_mode_setup_tests()
self.set_timeout(self.gui.share_mode, 120)
self.run_all_share_mode_started_tests(public_mode)
- self.timeout_widget_hidden(self.gui.share_mode)
+ self.autostop_timer_widget_hidden(self.gui.share_mode)
self.server_timed_out(self.gui.share_mode, 125000)
self.web_server_is_stopped()
diff --git a/tests/local_onionshare_receive_mode_timer_test.py b/tests/local_onionshare_receive_mode_timer_test.py
index 0acaa4a9..6687d154 100644
--- a/tests/local_onionshare_receive_mode_timer_test.py
+++ b/tests/local_onionshare_receive_mode_timer_test.py
@@ -9,7 +9,7 @@ class LocalReceiveModeTimerTest(unittest.TestCase, GuiReceiveTest):
def setUpClass(cls):
test_settings = {
"public_mode": False,
- "shutdown_timeout": True,
+ "autostop_timer": True,
}
cls.gui = GuiReceiveTest.set_up(test_settings)
diff --git a/tests/local_onionshare_share_mode_startup_and_shutdown_timer_mismatch_test.py b/tests/local_onionshare_share_mode_autostart_and_autostop_timer_mismatch_test.py
index b3af8e17..2017e58d 100644
--- a/tests/local_onionshare_share_mode_startup_and_shutdown_timer_mismatch_test.py
+++ b/tests/local_onionshare_share_mode_autostart_and_autostop_timer_mismatch_test.py
@@ -10,7 +10,7 @@ class LocalShareModeStartupTimerTest(unittest.TestCase, GuiShareTest):
test_settings = {
"public_mode": False,
"startup_timer": True,
- "shutdown_timeout": True,
+ "autostop_timer": True,
}
cls.gui = GuiShareTest.set_up(test_settings)
@@ -21,7 +21,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_shutdown_mismatch_tests(False)
+ self.run_all_share_mode_autostop_autostart_mismatch_tests(False)
if __name__ == "__main__":
unittest.main()
diff --git a/tests/local_onionshare_share_mode_timer_test.py b/tests/local_onionshare_share_mode_timer_test.py
index e30ce4ec..ee47a07d 100644
--- a/tests/local_onionshare_share_mode_timer_test.py
+++ b/tests/local_onionshare_share_mode_timer_test.py
@@ -9,7 +9,7 @@ class LocalShareModeTimerTest(unittest.TestCase, GuiShareTest):
def setUpClass(cls):
test_settings = {
"public_mode": False,
- "shutdown_timeout": True,
+ "autostop_timer": True,
}
cls.gui = GuiShareTest.set_up(test_settings)
diff --git a/tests/local_onionshare_share_mode_timer_too_short_test.py b/tests/local_onionshare_share_mode_timer_too_short_test.py
index 8d22048d..fce895d3 100644
--- a/tests/local_onionshare_share_mode_timer_too_short_test.py
+++ b/tests/local_onionshare_share_mode_timer_too_short_test.py
@@ -10,7 +10,7 @@ class LocalShareModeTimerTooShortTest(unittest.TestCase, GuiShareTest):
def setUpClass(cls):
test_settings = {
"public_mode": False,
- "shutdown_timeout": True,
+ "autostop_timer": True,
}
cls.gui = GuiShareTest.set_up(test_settings)
diff --git a/tests/onionshare_share_mode_timer_test.py b/tests/onionshare_share_mode_timer_test.py
index 7f636a71..65ef1e38 100644
--- a/tests/onionshare_share_mode_timer_test.py
+++ b/tests/onionshare_share_mode_timer_test.py
@@ -9,7 +9,7 @@ class ShareModeTimerTest(unittest.TestCase, TorGuiShareTest):
def setUpClass(cls):
test_settings = {
"public_mode": False,
- "shutdown_timeout": True,
+ "autostop_timer": True,
}
cls.gui = TorGuiShareTest.set_up(test_settings)
diff --git a/tests/test_onionshare_settings.py b/tests/test_onionshare_settings.py
index 74ab4f8f..40eb9a0f 100644
--- a/tests/test_onionshare_settings.py
+++ b/tests/test_onionshare_settings.py
@@ -51,7 +51,7 @@ class TestSettings:
'auth_type': 'no_auth',
'auth_password': '',
'close_after_first_download': True,
- 'shutdown_timeout': False,
+ 'autostop_timer': False,
'startup_timer': False,
'use_stealth': False,
'use_autoupdate': True,