summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMiguel Jacq <mig@mig5.net>2019-03-11 15:55:17 +1100
committerMiguel Jacq <mig@mig5.net>2019-03-11 15:55:17 +1100
commit365798b12f1e887d75b20266f0b636c756969427 (patch)
tree041c9856b4baecdc3e46f3e3caacbb6536052ef4 /tests
parent040e7e4ca9c383248457496a9071dba16134e138 (diff)
downloadonionshare-365798b12f1e887d75b20266f0b636c756969427.tar.gz
onionshare-365798b12f1e887d75b20266f0b636c756969427.zip
Various Startup Timer fixes for strings, bundled mode, stealth mode, startup/shutdown time clashes
Diffstat (limited to 'tests')
-rw-r--r--tests/GuiShareTest.py9
-rw-r--r--tests/local_onionshare_share_mode_startup_and_shutdown_timer_mismatch_test.py27
2 files changed, 36 insertions, 0 deletions
diff --git a/tests/GuiShareTest.py b/tests/GuiShareTest.py
index c6f71272..e8b31451 100644
--- a/tests/GuiShareTest.py
+++ b/tests/GuiShareTest.py
@@ -206,6 +206,15 @@ 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):
+ """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_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)
+ self.server_is_stopped(self.gui.share_mode, False)
+
def run_all_share_mode_unreadable_file_tests(self):
'''Attempt to share an unreadable file'''
self.run_all_share_mode_setup_tests()
diff --git a/tests/local_onionshare_share_mode_startup_and_shutdown_timer_mismatch_test.py b/tests/local_onionshare_share_mode_startup_and_shutdown_timer_mismatch_test.py
new file mode 100644
index 00000000..b3af8e17
--- /dev/null
+++ b/tests/local_onionshare_share_mode_startup_and_shutdown_timer_mismatch_test.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python3
+import pytest
+import unittest
+
+from .GuiShareTest import GuiShareTest
+
+class LocalShareModeStartupTimerTest(unittest.TestCase, GuiShareTest):
+ @classmethod
+ def setUpClass(cls):
+ test_settings = {
+ "public_mode": False,
+ "startup_timer": True,
+ "shutdown_timeout": True,
+ }
+ cls.gui = GuiShareTest.set_up(test_settings)
+
+ @classmethod
+ def tearDownClass(cls):
+ GuiShareTest.tear_down()
+
+ @pytest.mark.gui
+ def test_gui(self):
+ self.run_all_common_setup_tests()
+ self.run_all_share_mode_startup_shutdown_mismatch_tests(False)
+
+if __name__ == "__main__":
+ unittest.main()