mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-01 21:02:11 -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
|
@ -19,7 +19,7 @@ class GuiReceiveTest(GuiBaseTest):
|
|||
QtTest.QTest.qWait(2000)
|
||||
|
||||
files = {"file[]": open(file_to_upload, "rb")}
|
||||
url = "http://127.0.0.1:{}/upload".format(self.gui.app.port)
|
||||
url = f"http://127.0.0.1:{self.gui.app.port}/upload"
|
||||
if public_mode:
|
||||
r = requests.post(url, files=files)
|
||||
if identical_files_at_once:
|
||||
|
@ -68,7 +68,7 @@ class GuiReceiveTest(GuiBaseTest):
|
|||
def upload_file_should_fail(self, public_mode):
|
||||
"""Test that we can't upload the file when permissions are wrong, and expected content is shown"""
|
||||
files = {"file[]": open("/tmp/test.txt", "rb")}
|
||||
url = "http://127.0.0.1:{}/upload".format(self.gui.app.port)
|
||||
url = f"http://127.0.0.1:{self.gui.app.port}/upload"
|
||||
if public_mode:
|
||||
r = requests.post(url, files=files)
|
||||
else:
|
||||
|
@ -88,9 +88,9 @@ class GuiReceiveTest(GuiBaseTest):
|
|||
os.chmod("/tmp/OnionShare", mode)
|
||||
|
||||
def try_without_auth_in_non_public_mode(self):
|
||||
r = requests.post("http://127.0.0.1:{}/upload".format(self.gui.app.port))
|
||||
r = requests.post(f"http://127.0.0.1:{self.gui.app.port}/upload")
|
||||
self.assertEqual(r.status_code, 401)
|
||||
r = requests.get("http://127.0.0.1:{}/close".format(self.gui.app.port))
|
||||
r = requests.get(f"http://127.0.0.1:{self.gui.app.port}/close")
|
||||
self.assertEqual(r.status_code, 401)
|
||||
|
||||
# 'Grouped' tests follow from here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue