mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-31 04:04:16 -04:00
Replace .format with python 3.6 f-strings in tests
This commit is contained in:
parent
25b2f389db
commit
098625621c
8 changed files with 35 additions and 55 deletions
|
@ -105,7 +105,7 @@ class GuiShareTest(GuiBaseTest):
|
|||
|
||||
def download_share(self, public_mode):
|
||||
"""Test that we can download the share"""
|
||||
url = "http://127.0.0.1:{}/download".format(self.gui.app.port)
|
||||
url = f"http://127.0.0.1:{self.gui.app.port}/download"
|
||||
if public_mode:
|
||||
r = requests.get(url)
|
||||
else:
|
||||
|
@ -126,8 +126,8 @@ class GuiShareTest(GuiBaseTest):
|
|||
|
||||
def individual_file_is_viewable_or_not(self, public_mode, stay_open):
|
||||
"""Test whether an individual file is viewable (when in stay_open mode) and that it isn't (when not in stay_open mode)"""
|
||||
url = "http://127.0.0.1:{}".format(self.gui.app.port)
|
||||
download_file_url = "http://127.0.0.1:{}/test.txt".format(self.gui.app.port)
|
||||
url = f"http://127.0.0.1:{self.gui.app.port}"
|
||||
download_file_url = f"http://127.0.0.1:{self.gui.app.port}/test.txt"
|
||||
if public_mode:
|
||||
r = requests.get(url)
|
||||
else:
|
||||
|
@ -175,7 +175,7 @@ class GuiShareTest(GuiBaseTest):
|
|||
|
||||
def hit_401(self, public_mode):
|
||||
"""Test that the server stops after too many 401s, or doesn't when in public_mode"""
|
||||
url = "http://127.0.0.1:{}/".format(self.gui.app.port)
|
||||
url = f"http://127.0.0.1:{self.gui.app.port}/"
|
||||
|
||||
for _ in range(20):
|
||||
password_guess = self.gui.common.build_password()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue