From 111f69f30e2d46ac033261e689b02c77ed1afac6 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Thu, 27 Sep 2018 17:34:46 -0700 Subject: [PATCH] Remove all the extra QApplications --- tests_gui_local/onionshare_receive_mode_upload_test.py | 6 ++---- .../onionshare_receive_mode_upload_test_public_mode.py | 6 ++---- tests_gui_local/onionshare_share_mode_download_test.py | 4 +--- .../onionshare_share_mode_download_test_public_mode.py | 4 +--- .../onionshare_share_mode_download_test_stay_open.py | 4 +--- tests_gui_local/onionshare_slug_persistent_test.py | 4 +--- tests_gui_local/onionshare_timer_test.py | 4 +--- tests_gui_tor/onionshare_receive_mode_upload_test.py | 6 ++---- .../onionshare_receive_mode_upload_test_public_mode.py | 6 ++---- tests_gui_tor/onionshare_share_mode_cancel_share_test.py | 4 +--- tests_gui_tor/onionshare_share_mode_download_test.py | 4 +--- .../onionshare_share_mode_download_test_public_mode.py | 4 +--- .../onionshare_share_mode_download_test_stay_open.py | 4 +--- tests_gui_tor/onionshare_share_mode_persistent_test.py | 4 +--- tests_gui_tor/onionshare_share_mode_stealth_test.py | 4 +--- .../onionshare_share_mode_tor_connection_killed_test.py | 4 +--- tests_gui_tor/onionshare_timer_test.py | 4 +--- tests_gui_tor/onionshare_tor_connection_killed_test.py | 4 +--- 18 files changed, 22 insertions(+), 58 deletions(-) diff --git a/tests_gui_local/onionshare_receive_mode_upload_test.py b/tests_gui_local/onionshare_receive_mode_upload_test.py index bac622fb..2aa2ed94 100644 --- a/tests_gui_local/onionshare_receive_mode_upload_test.py +++ b/tests_gui_local/onionshare_receive_mode_upload_test.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' @classmethod @@ -48,7 +46,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": False, "receive_allow_receiver_shutdown": True, @@ -72,7 +70,7 @@ class OnionShareGuiTest(unittest.TestCase): open(testsettings, 'w').write(json.dumps(test_settings)) cls.gui = OnionShareGui(common, testonion, qtapp, app, ['/tmp/test.txt'], testsettings, True) - + @classmethod def tearDownClass(cls): '''Clean up after tests''' diff --git a/tests_gui_local/onionshare_receive_mode_upload_test_public_mode.py b/tests_gui_local/onionshare_receive_mode_upload_test_public_mode.py index 8ed385f5..30a290e7 100644 --- a/tests_gui_local/onionshare_receive_mode_upload_test_public_mode.py +++ b/tests_gui_local/onionshare_receive_mode_upload_test_public_mode.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' @classmethod @@ -48,7 +46,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": True, "receive_allow_receiver_shutdown": True, @@ -72,7 +70,7 @@ class OnionShareGuiTest(unittest.TestCase): open(testsettings, 'w').write(json.dumps(test_settings)) cls.gui = OnionShareGui(common, testonion, qtapp, app, ['/tmp/test.txt'], testsettings, True) - + @classmethod def tearDownClass(cls): '''Clean up after tests''' diff --git a/tests_gui_local/onionshare_share_mode_download_test.py b/tests_gui_local/onionshare_share_mode_download_test.py index 0ef03e97..c546fb61 100644 --- a/tests_gui_local/onionshare_share_mode_download_test.py +++ b/tests_gui_local/onionshare_share_mode_download_test.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' @classmethod @@ -48,7 +46,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": False, "receive_allow_receiver_shutdown": True, diff --git a/tests_gui_local/onionshare_share_mode_download_test_public_mode.py b/tests_gui_local/onionshare_share_mode_download_test_public_mode.py index 417eb8b9..764b5885 100644 --- a/tests_gui_local/onionshare_share_mode_download_test_public_mode.py +++ b/tests_gui_local/onionshare_share_mode_download_test_public_mode.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' @classmethod @@ -48,7 +46,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": True, "receive_allow_receiver_shutdown": True, diff --git a/tests_gui_local/onionshare_share_mode_download_test_stay_open.py b/tests_gui_local/onionshare_share_mode_download_test_stay_open.py index c3177a38..b92ff097 100644 --- a/tests_gui_local/onionshare_share_mode_download_test_stay_open.py +++ b/tests_gui_local/onionshare_share_mode_download_test_stay_open.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' @classmethod @@ -48,7 +46,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": True, "receive_allow_receiver_shutdown": True, diff --git a/tests_gui_local/onionshare_slug_persistent_test.py b/tests_gui_local/onionshare_slug_persistent_test.py index 05c9719a..1e5614dc 100644 --- a/tests_gui_local/onionshare_slug_persistent_test.py +++ b/tests_gui_local/onionshare_slug_persistent_test.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' slug = '' @@ -50,7 +48,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": False, "receive_allow_receiver_shutdown": True, diff --git a/tests_gui_local/onionshare_timer_test.py b/tests_gui_local/onionshare_timer_test.py index f36331b8..1a5134e2 100644 --- a/tests_gui_local/onionshare_timer_test.py +++ b/tests_gui_local/onionshare_timer_test.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' @classmethod @@ -48,7 +46,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": False, "receive_allow_receiver_shutdown": True, diff --git a/tests_gui_tor/onionshare_receive_mode_upload_test.py b/tests_gui_tor/onionshare_receive_mode_upload_test.py index 5c2945f1..5be400e2 100644 --- a/tests_gui_tor/onionshare_receive_mode_upload_test.py +++ b/tests_gui_tor/onionshare_receive_mode_upload_test.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' @classmethod @@ -48,7 +46,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": False, "receive_allow_receiver_shutdown": True, @@ -72,7 +70,7 @@ class OnionShareGuiTest(unittest.TestCase): open(testsettings, 'w').write(json.dumps(test_settings)) cls.gui = OnionShareGui(common, testonion, qtapp, app, ['/tmp/test.txt'], testsettings, False) - + @classmethod def tearDownClass(cls): '''Clean up after tests''' diff --git a/tests_gui_tor/onionshare_receive_mode_upload_test_public_mode.py b/tests_gui_tor/onionshare_receive_mode_upload_test_public_mode.py index 86cde0d9..9c9553a4 100644 --- a/tests_gui_tor/onionshare_receive_mode_upload_test_public_mode.py +++ b/tests_gui_tor/onionshare_receive_mode_upload_test_public_mode.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' @classmethod @@ -48,7 +46,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": True, "receive_allow_receiver_shutdown": True, @@ -72,7 +70,7 @@ class OnionShareGuiTest(unittest.TestCase): open(testsettings, 'w').write(json.dumps(test_settings)) cls.gui = OnionShareGui(common, testonion, qtapp, app, ['/tmp/test.txt'], testsettings, False) - + @classmethod def tearDownClass(cls): '''Clean up after tests''' diff --git a/tests_gui_tor/onionshare_share_mode_cancel_share_test.py b/tests_gui_tor/onionshare_share_mode_cancel_share_test.py index a2d1a06a..466109d7 100644 --- a/tests_gui_tor/onionshare_share_mode_cancel_share_test.py +++ b/tests_gui_tor/onionshare_share_mode_cancel_share_test.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' @classmethod @@ -48,7 +46,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": False, "receive_allow_receiver_shutdown": True, diff --git a/tests_gui_tor/onionshare_share_mode_download_test.py b/tests_gui_tor/onionshare_share_mode_download_test.py index d1eb5b54..1c8e1b6c 100644 --- a/tests_gui_tor/onionshare_share_mode_download_test.py +++ b/tests_gui_tor/onionshare_share_mode_download_test.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' @classmethod @@ -48,7 +46,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": False, "receive_allow_receiver_shutdown": True, diff --git a/tests_gui_tor/onionshare_share_mode_download_test_public_mode.py b/tests_gui_tor/onionshare_share_mode_download_test_public_mode.py index 4e5f1114..c292e729 100644 --- a/tests_gui_tor/onionshare_share_mode_download_test_public_mode.py +++ b/tests_gui_tor/onionshare_share_mode_download_test_public_mode.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' @classmethod @@ -48,7 +46,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": True, "receive_allow_receiver_shutdown": True, diff --git a/tests_gui_tor/onionshare_share_mode_download_test_stay_open.py b/tests_gui_tor/onionshare_share_mode_download_test_stay_open.py index 78cd1578..7838316f 100644 --- a/tests_gui_tor/onionshare_share_mode_download_test_stay_open.py +++ b/tests_gui_tor/onionshare_share_mode_download_test_stay_open.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' @classmethod @@ -48,7 +46,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": True, "receive_allow_receiver_shutdown": True, diff --git a/tests_gui_tor/onionshare_share_mode_persistent_test.py b/tests_gui_tor/onionshare_share_mode_persistent_test.py index a2d429b2..3cffaab6 100644 --- a/tests_gui_tor/onionshare_share_mode_persistent_test.py +++ b/tests_gui_tor/onionshare_share_mode_persistent_test.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' slug = '' @@ -51,7 +49,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": False, "receive_allow_receiver_shutdown": True, diff --git a/tests_gui_tor/onionshare_share_mode_stealth_test.py b/tests_gui_tor/onionshare_share_mode_stealth_test.py index 948e834a..aaf6fbc6 100644 --- a/tests_gui_tor/onionshare_share_mode_stealth_test.py +++ b/tests_gui_tor/onionshare_share_mode_stealth_test.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' @classmethod @@ -48,7 +46,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": False, "receive_allow_receiver_shutdown": True, diff --git a/tests_gui_tor/onionshare_share_mode_tor_connection_killed_test.py b/tests_gui_tor/onionshare_share_mode_tor_connection_killed_test.py index 3eeea9bc..861b7ccc 100644 --- a/tests_gui_tor/onionshare_share_mode_tor_connection_killed_test.py +++ b/tests_gui_tor/onionshare_share_mode_tor_connection_killed_test.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' @classmethod @@ -48,7 +46,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": False, "receive_allow_receiver_shutdown": True, diff --git a/tests_gui_tor/onionshare_timer_test.py b/tests_gui_tor/onionshare_timer_test.py index 865b3a8b..b76106d9 100644 --- a/tests_gui_tor/onionshare_timer_test.py +++ b/tests_gui_tor/onionshare_timer_test.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' @classmethod @@ -48,7 +46,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": False, "receive_allow_receiver_shutdown": True, diff --git a/tests_gui_tor/onionshare_tor_connection_killed_test.py b/tests_gui_tor/onionshare_tor_connection_killed_test.py index 3eeea9bc..861b7ccc 100644 --- a/tests_gui_tor/onionshare_tor_connection_killed_test.py +++ b/tests_gui_tor/onionshare_tor_connection_killed_test.py @@ -14,8 +14,6 @@ from onionshare_gui import * from .commontests import CommonTests -app = QtWidgets.QApplication(sys.argv) - class OnionShareGuiTest(unittest.TestCase): '''Test the OnionShare GUI''' @classmethod @@ -48,7 +46,7 @@ class OnionShareGuiTest(unittest.TestCase): "control_port_port": 9051, "downloads_dir": "/tmp/OnionShare", "hidservauth_string": "", - "no_bridges": True, + "no_bridges": True, "private_key": "", "public_mode": False, "receive_allow_receiver_shutdown": True,