diff options
author | Miguel Jacq <mig@mig5.net> | 2019-09-03 12:36:05 +1000 |
---|---|---|
committer | Miguel Jacq <mig@mig5.net> | 2019-09-03 12:36:05 +1000 |
commit | f6eb80d5b595db7bc48c72357461a0ae86a58f89 (patch) | |
tree | 4279a994011f0bea0d9f29923c59b69f416db5f6 /tests | |
parent | 273b893946cf89ec29766b7fb62c49846d8b7b76 (diff) | |
download | onionshare-f6eb80d5b595db7bc48c72357461a0ae86a58f89.tar.gz onionshare-f6eb80d5b595db7bc48c72357461a0ae86a58f89.zip |
Test to make sure that we *can't* download an individual file when not in stay_open mode, not just that the hyperlink is not present in the page markup
Diffstat (limited to 'tests')
-rw-r--r-- | tests/GuiShareTest.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/GuiShareTest.py b/tests/GuiShareTest.py index 34573a19..be3f42e3 100644 --- a/tests/GuiShareTest.py +++ b/tests/GuiShareTest.py @@ -105,6 +105,11 @@ class GuiShareTest(GuiBaseTest): with open(tmp_file.name, 'r') as f: self.assertEqual('onionshare', f.read()) else: + if public_mode: + r = requests.get(download_file_url) + else: + r = requests.get(download_file_url, auth=requests.auth.HTTPBasicAuth('onionshare', self.gui.share_mode.server_status.web.password)) + self.assertEqual(r.status_code, 404) self.assertFalse('a href="/test.txt"' in r.text) self.download_share(public_mode) |