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

This commit is contained in:
Miguel Jacq 2019-09-03 12:36:05 +10:00
parent 273b893946
commit f6eb80d5b5
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6

View File

@ -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)