diff options
author | Saptak Sengupta <saptak013@gmail.com> | 2023-06-06 13:01:24 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-06 13:01:24 +0530 |
commit | f3fec65ef4c91f1225328da5f682c3ba8ea5f0ba (patch) | |
tree | 5e6be2c1d0313efb9ba8244b8546645a23132fdb /desktop/tests/test_gui_share.py | |
parent | efaa5105e731fc7f8dd41162f7bee0e787ca2b16 (diff) | |
parent | d6c732e20c5dac738462eb438272bfc053d844ce (diff) | |
download | onionshare-f3fec65ef4c91f1225328da5f682c3ba8ea5f0ba.tar.gz onionshare-f3fec65ef4c91f1225328da5f682c3ba8ea5f0ba.zip |
Merge pull request #1677 from onionshare/update-deps
Update deps & switch to waitress for running flask servers
Diffstat (limited to 'desktop/tests/test_gui_share.py')
-rw-r--r-- | desktop/tests/test_gui_share.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/desktop/tests/test_gui_share.py b/desktop/tests/test_gui_share.py index 02d50e4b..f0c460f2 100644 --- a/desktop/tests/test_gui_share.py +++ b/desktop/tests/test_gui_share.py @@ -541,3 +541,30 @@ class TestShare(GuiBaseTest): self.hit_405(url, expected_resp="OnionShare: 405 Method Not Allowed", data = {'foo':'bar'}, methods = ["put", "post", "delete", "options"]) self.history_widgets_present(tab) self.close_all_tabs() + + + def test_compression(self): + """ + A file with a compressable mimetype should return a Content-Encoding header + with gzip compression enabled. + """ + tab = self.new_share_tab() + tab.get_mode().autostop_sharing_checkbox.click() + + self.run_all_common_setup_tests() + self.run_all_share_mode_setup_tests(tab) + tab.get_mode().mode_settings_widget.public_checkbox.click() + tab.get_mode().remove_all_button.click() + tab.get_mode().server_status.file_selection.file_list.add_file( + self.tmpfile_test_html + ) + self.run_all_share_mode_started_tests(tab) + url = f"http://127.0.0.1:{tab.app.port}/test.html" + r = requests.get(url) + self.assertTrue("Content-Encoding" in r.headers) + self.assertEqual("gzip", r.headers["Content-Encoding"]) + + self.server_is_stopped(tab) + self.web_server_is_stopped(tab) + self.server_status_indicator_says_closed(tab) + self.close_all_tabs() |