diff options
author | Miguel Jacq <mig@mig5.net> | 2021-08-28 09:41:31 +1000 |
---|---|---|
committer | Miguel Jacq <mig@mig5.net> | 2021-08-28 09:41:31 +1000 |
commit | 268b27232f6400d31ad3620ab011eb98b2e25431 (patch) | |
tree | 0826427a1334f4b47a3a20577cca67e2bfbbfa59 | |
parent | a08f303f894b20bb9562b7c8690a0987a0855120 (diff) | |
download | onionshare-268b27232f6400d31ad3620ab011eb98b2e25431.tar.gz onionshare-268b27232f6400d31ad3620ab011eb98b2e25431.zip |
Test that the Private Key button is not present in public mode, in GUI share tests
-rw-r--r-- | desktop/tests/gui_base_test.py | 6 | ||||
-rw-r--r-- | desktop/tests/test_gui_share.py | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/desktop/tests/gui_base_test.py b/desktop/tests/gui_base_test.py index 83d170f1..ac2dfc54 100644 --- a/desktop/tests/gui_base_test.py +++ b/desktop/tests/gui_base_test.py @@ -435,6 +435,12 @@ class GuiBaseTest(unittest.TestCase): clipboard = tab.common.gui.qtapp.clipboard() self.assertEqual(clipboard.text(), "E2GOT5LTUTP3OAMRCRXO4GSH6VKJEUOXZQUC336SRKAHTTT5OVSA") + def clientauth_is_not_visible(self, tab): + """Test that the ClientAuth button is not visible""" + self.assertFalse( + tab.get_mode().server_status.copy_client_auth_button.isVisible() + ) + def hit_405(self, url, expected_resp, data = {}, methods = [] ): """Test various HTTP methods and the response""" for method in methods: diff --git a/desktop/tests/test_gui_share.py b/desktop/tests/test_gui_share.py index 87408d49..b7a66a81 100644 --- a/desktop/tests/test_gui_share.py +++ b/desktop/tests/test_gui_share.py @@ -507,6 +507,17 @@ class TestShare(GuiBaseTest): self.close_all_tabs() + # Now try in public mode + tab = self.new_share_tab() + tab.get_mode().mode_settings_widget.public_checkbox.click() + self.run_all_common_setup_tests() + self.run_all_share_mode_setup_tests(tab) + self.run_all_share_mode_started_tests(tab) + self.clientauth_is_not_visible(tab) + + self.close_all_tabs() + + def test_405_page_returned_for_invalid_methods(self): """ Our custom 405 page should return for invalid methods |