diff options
Diffstat (limited to 'desktop/tests/test_gui_receive.py')
-rw-r--r-- | desktop/tests/test_gui_receive.py | 62 |
1 files changed, 11 insertions, 51 deletions
diff --git a/desktop/tests/test_gui_receive.py b/desktop/tests/test_gui_receive.py index b523b0fa..ca69c957 100644 --- a/desktop/tests/test_gui_receive.py +++ b/desktop/tests/test_gui_receive.py @@ -23,28 +23,10 @@ class TestReceive(GuiBaseTest): files = {"file[]": open(file_to_upload, "rb")} url = f"http://127.0.0.1:{tab.app.port}/upload" - if tab.settings.get("general", "public"): + requests.post(url, files=files) + if identical_files_at_once: + # Send a duplicate upload to test for collisions requests.post(url, files=files) - if identical_files_at_once: - # Send a duplicate upload to test for collisions - requests.post(url, files=files) - else: - requests.post( - url, - files=files, - auth=requests.auth.HTTPBasicAuth( - "onionshare", tab.get_mode().web.password - ), - ) - if identical_files_at_once: - # Send a duplicate upload to test for collisions - requests.post( - url, - files=files, - auth=requests.auth.HTTPBasicAuth( - "onionshare", tab.get_mode().web.password - ), - ) QtTest.QTest.qWait(1000, self.gui.qtapp) @@ -74,16 +56,7 @@ class TestReceive(GuiBaseTest): files = {"file[]": open(self.tmpfile_test, "rb")} url = f"http://127.0.0.1:{tab.app.port}/upload" - if tab.settings.get("general", "public"): - r = requests.post(url, files=files) - else: - r = requests.post( - url, - files=files, - auth=requests.auth.HTTPBasicAuth( - "onionshare", tab.get_mode().web.password - ), - ) + r = requests.post(url, files=files) def accept_dialog(): window = tab.common.gui.qtapp.activeWindow() @@ -100,16 +73,7 @@ class TestReceive(GuiBaseTest): QtTest.QTest.qWait(2000, self.gui.qtapp) url = f"http://127.0.0.1:{tab.app.port}/upload" - if tab.settings.get("general", "public"): - requests.post(url, data={"text": message}) - else: - requests.post( - url, - data={"text": message}, - auth=requests.auth.HTTPBasicAuth( - "onionshare", tab.get_mode().web.password - ), - ) + requests.post(url, data={"text": message}) QtTest.QTest.qWait(1000, self.gui.qtapp) @@ -134,12 +98,6 @@ class TestReceive(GuiBaseTest): self.assertTrue(exists) - def try_without_auth_in_non_public_mode(self, tab): - r = requests.post(f"http://127.0.0.1:{tab.app.port}/upload") - self.assertEqual(r.status_code, 401) - r = requests.get(f"http://127.0.0.1:{tab.app.port}/close") - self.assertEqual(r.status_code, 401) - # 'Grouped' tests follow from here def run_all_receive_mode_setup_tests(self, tab): @@ -151,17 +109,19 @@ class TestReceive(GuiBaseTest): self.server_status_indicator_says_starting(tab) self.server_is_started(tab) self.web_server_is_running(tab) - self.have_a_password(tab) self.url_description_shown(tab) + self.url_instructions_shown(tab) + self.url_shown(tab) self.have_copy_url_button(tab) - self.have_show_qr_code_button(tab) + self.have_show_url_qr_code_button(tab) + self.client_auth_instructions_shown(tab) + self.private_key_shown(tab) + self.have_show_client_auth_qr_code_button(tab) self.server_status_indicator_says_started(tab) def run_all_receive_mode_tests(self, tab): """Submit files and messages in receive mode and stop the share""" self.run_all_receive_mode_setup_tests(tab) - if not tab.settings.get("general", "public"): - self.try_without_auth_in_non_public_mode(tab) self.upload_file(tab, self.tmpfile_test, "test.txt") self.history_widgets_present(tab) self.counter_incremented(tab, 1) |