Skip to content

Commit

Permalink
style: format with ruff 2025
Browse files Browse the repository at this point in the history
  • Loading branch information
haatveit committed Feb 11, 2025
1 parent 8d32c04 commit dac9e28
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions tsdfileapi/resumables.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,16 +607,16 @@ def delete(
owner: str,
) -> bool:
try:
assert self._db_upload_belongs_to_owner(
upload_id
), "upload does not belong to user"
assert self._db_upload_belongs_to_owner(upload_id), (
"upload does not belong to user"
)
relevant_dir = work_dir + "/" + upload_id
relevant_merged_file = work_dir + "/" + filename + "." + upload_id
shutil.rmtree(relevant_dir)
os.remove(relevant_merged_file)
assert self._db_remove_completed_for_owner(
upload_id
), "could not remove data from resumables db"
assert self._db_remove_completed_for_owner(upload_id), (
"could not remove data from resumables db"
)
return True
except (Exception, AssertionError) as e:
logger.error(e)
Expand Down
6 changes: 3 additions & 3 deletions tsdfileapi/test_file_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def use_generic_table(self, app_route: str, url_tokens_method: str) -> None:
self.assertTrue(resp.status_code in [200, 201])

def test_tables(self) -> None:
headers = {"Authorization": f'Bearer {TEST_TOKENS["EXPORT"]}'}
headers = {"Authorization": f"Bearer {TEST_TOKENS['EXPORT']}"}

# if it exists
resp = requests.delete(
Expand Down Expand Up @@ -1261,7 +1261,7 @@ def test_ZM2_resume_upload_with_directory(self) -> None:
from urllib.parse import quote

target = os.path.basename(self.resume_file1)
url = f'{self.resumables}/{target}?key={quote(top_level_dir, safe="")}'
url = f"{self.resumables}/{target}?key={quote(top_level_dir, safe='')}"
env = "" # not used when passing url
resp = fileapi.get_resumable(
env,
Expand All @@ -1270,7 +1270,7 @@ def test_ZM2_resume_upload_with_directory(self) -> None:
dev_url=url,
).get("overview")
self.assertEqual(resp["id"], top_id)
url = f'{self.resumables}/{target}?key={quote(sub_dir, safe="")}'
url = f"{self.resumables}/{target}?key={quote(sub_dir, safe='')}"
resp = fileapi.get_resumable(
env,
self.test_project,
Expand Down

0 comments on commit dac9e28

Please sign in to comment.