diff --git a/tests_gui_local/GuiBaseTest.py b/tests_gui_local/GuiBaseTest.py index 449a5b7e..8a8b127e 100644 --- a/tests_gui_local/GuiBaseTest.py +++ b/tests_gui_local/GuiBaseTest.py @@ -19,7 +19,7 @@ from onionshare_gui.mode.receive_mode import ReceiveMode class GuiBaseTest(object): @staticmethod - def set_up(test_settings, settings_filename): + def set_up(test_settings): '''Create GUI with given settings''' # Create our test file testfile = open('/tmp/test.txt', 'w') @@ -44,7 +44,8 @@ class GuiBaseTest(object): app = OnionShare(common, testonion, True, 0) web = Web(common, False, True) - open('/tmp/{}.json'.format(settings_filename), 'w').write(json.dumps(test_settings)) + settings_filename = '/tmp/testsettings.json' + open(settings_filename, 'w').write(json.dumps(test_settings)) gui = OnionShareGui(common, testonion, qtapp, app, ['/tmp/test.txt'], settings_filename, True) return gui @@ -53,7 +54,6 @@ class GuiBaseTest(object): def tear_down(): try: os.remove('/tmp/test.txt') - os.remove('/tmp/download.zip') shutil.rmtree('/tmp/OnionShare') except: pass diff --git a/tests_gui_local/onionshare_receive_mode_upload_public_mode_test.py b/tests_gui_local/onionshare_receive_mode_upload_public_mode_test.py index 32ea8656..f41a2ce2 100644 --- a/tests_gui_local/onionshare_receive_mode_upload_public_mode_test.py +++ b/tests_gui_local/onionshare_receive_mode_upload_public_mode_test.py @@ -11,7 +11,7 @@ class ReceiveModePublicModeTest(unittest.TestCase, GuiReceiveTest): "public_mode": True, "receive_allow_receiver_shutdown": True } - cls.gui = GuiReceiveTest.set_up(test_settings, 'ReceiveModePublicModeTest') + cls.gui = GuiReceiveTest.set_up(test_settings) @classmethod def tearDownClass(cls): diff --git a/tests_gui_local/onionshare_receive_mode_upload_test.py b/tests_gui_local/onionshare_receive_mode_upload_test.py index c59ac9c0..8a7661dd 100644 --- a/tests_gui_local/onionshare_receive_mode_upload_test.py +++ b/tests_gui_local/onionshare_receive_mode_upload_test.py @@ -10,7 +10,7 @@ class ReceiveModeTest(unittest.TestCase, GuiReceiveTest): test_settings = { "receive_allow_receiver_shutdown": True } - cls.gui = GuiReceiveTest.set_up(test_settings, 'ReceiveModeTest') + cls.gui = GuiReceiveTest.set_up(test_settings) @classmethod def tearDownClass(cls): diff --git a/tests_gui_local/onionshare_share_mode_download_public_mode_test.py b/tests_gui_local/onionshare_share_mode_download_public_mode_test.py index b6ce3a3c..53d1fb8c 100644 --- a/tests_gui_local/onionshare_share_mode_download_public_mode_test.py +++ b/tests_gui_local/onionshare_share_mode_download_public_mode_test.py @@ -10,7 +10,7 @@ class ShareModePublicModeTest(unittest.TestCase, GuiShareTest): test_settings = { "public_mode": True, } - cls.gui = GuiShareTest.set_up(test_settings, 'ShareModePublicModeTest') + cls.gui = GuiShareTest.set_up(test_settings) @classmethod def tearDownClass(cls): diff --git a/tests_gui_local/onionshare_share_mode_download_stay_open_test.py b/tests_gui_local/onionshare_share_mode_download_stay_open_test.py index 7ff9aaf2..b398f654 100644 --- a/tests_gui_local/onionshare_share_mode_download_stay_open_test.py +++ b/tests_gui_local/onionshare_share_mode_download_stay_open_test.py @@ -10,7 +10,7 @@ class ShareModeStayOpenTest(unittest.TestCase, GuiShareTest): test_settings = { "close_after_first_download": False, } - cls.gui = GuiShareTest.set_up(test_settings, 'ShareModeStayOpenTest') + cls.gui = GuiShareTest.set_up(test_settings) @classmethod def tearDownClass(cls): diff --git a/tests_gui_local/onionshare_share_mode_download_test.py b/tests_gui_local/onionshare_share_mode_download_test.py index 9de0a767..34532c59 100644 --- a/tests_gui_local/onionshare_share_mode_download_test.py +++ b/tests_gui_local/onionshare_share_mode_download_test.py @@ -9,7 +9,7 @@ class ShareModeTest(unittest.TestCase, GuiShareTest): def setUpClass(cls): test_settings = { } - cls.gui = GuiShareTest.set_up(test_settings, 'ShareModeTest') + cls.gui = GuiShareTest.set_up(test_settings) @classmethod def tearDownClass(cls): diff --git a/tests_gui_local/onionshare_share_mode_slug_persistent_test.py b/tests_gui_local/onionshare_share_mode_slug_persistent_test.py index 02cbdd27..b4c92f36 100644 --- a/tests_gui_local/onionshare_share_mode_slug_persistent_test.py +++ b/tests_gui_local/onionshare_share_mode_slug_persistent_test.py @@ -13,7 +13,7 @@ class ShareModePersistentSlugTest(unittest.TestCase, GuiShareTest): "save_private_key": True, "close_after_first_download": False, } - cls.gui = GuiShareTest.set_up(test_settings, 'ShareModePersistentSlugTest') + cls.gui = GuiShareTest.set_up(test_settings) @classmethod def tearDownClass(cls): diff --git a/tests_gui_local/onionshare_share_mode_timer_test.py b/tests_gui_local/onionshare_share_mode_timer_test.py index 96c48443..98902428 100644 --- a/tests_gui_local/onionshare_share_mode_timer_test.py +++ b/tests_gui_local/onionshare_share_mode_timer_test.py @@ -11,7 +11,7 @@ class ShareModeTimerTest(unittest.TestCase, GuiShareTest): "public_mode": False, "shutdown_timeout": True, } - cls.gui = GuiShareTest.set_up(test_settings, 'ShareModeTimerTest') + cls.gui = GuiShareTest.set_up(test_settings) @classmethod def tearDownClass(cls):