From ce7f67652733ec7f9fd5f4966a7f7a10bfdedef2 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sun, 2 May 2021 14:34:09 -0700 Subject: [PATCH] Fix GUI tests --- cli/onionshare_cli/web/receive_mode.py | 7 +++++-- desktop/tests/test_gui_receive.py | 5 ++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cli/onionshare_cli/web/receive_mode.py b/cli/onionshare_cli/web/receive_mode.py index a12f5456..f5aae296 100644 --- a/cli/onionshare_cli/web/receive_mode.py +++ b/cli/onionshare_cli/web/receive_mode.py @@ -583,8 +583,11 @@ class ReceiveModeRequest(Request): self.web.receive_mode.uploads_in_progress.remove(history_id) # If no files were written to self.receive_mode_dir, delete it - if len(os.listdir(self.receive_mode_dir)) == 0: - os.rmdir(self.receive_mode_dir) + try: + if len(os.listdir(self.receive_mode_dir)) == 0: + os.rmdir(self.receive_mode_dir) + except Exception: + pass def file_write_func(self, filename, length): """ diff --git a/desktop/tests/test_gui_receive.py b/desktop/tests/test_gui_receive.py index 848b2f11..7d544009 100644 --- a/desktop/tests/test_gui_receive.py +++ b/desktop/tests/test_gui_receive.py @@ -54,9 +54,9 @@ class TestReceive(GuiBaseTest): for _ in range(10): date_dir = now.strftime("%Y-%m-%d") if identical_files_at_once: - time_dir = now.strftime("%H.%M.%S-1") + time_dir = now.strftime("%H%M%S-1") else: - time_dir = now.strftime("%H.%M.%S") + time_dir = now.strftime("%H%M%S") receive_mode_dir = os.path.join( tab.settings.get("receive", "data_dir"), date_dir, time_dir ) @@ -115,7 +115,6 @@ class TestReceive(GuiBaseTest): self.have_copy_url_button(tab) self.have_show_qr_code_button(tab) self.server_status_indicator_says_started(tab) - self.web_page(tab, "Select the files you want to send, then click") def run_all_receive_mode_tests(self, tab): """Upload files in receive mode and stop the share"""