Skip to content

Commit a965354

Browse files
committed
fix(format): refactor using black
1 parent 47c6c66 commit a965354

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

fossology/report.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ class Report:
1818
"""Class dedicated to all "report" related endpoints"""
1919

2020
@retry(retry=retry_if_exception_type(TryAgain), stop=stop_after_attempt(3))
21-
def generate_report(self, upload: Upload, report_format: ReportFormat = None, group: str = None):
21+
def generate_report(
22+
self, upload: Upload, report_format: ReportFormat = None, group: str = None
23+
):
2224
"""Generate a report for a given upload
2325
2426
API Endpoint: GET /report

fossology/uploads.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ class Uploads:
1818

1919
# Retry until the unpack agent is finished
2020
@retry(retry=retry_if_exception_type(TryAgain), stop=stop_after_attempt(10))
21-
def detail_upload(self, upload_id: int, group: str = None, wait_time: int = 0) -> Upload:
21+
def detail_upload(
22+
self, upload_id: int, group: str = None, wait_time: int = 0
23+
) -> Upload:
2224
"""Get detailled information about an upload
2325
2426
API Endpoint: GET /uploads/{id}

tests/test_uploads.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ def test_upload_from_vcs(foss: Fossology):
7070
access_level=AccessLevel.PUBLIC,
7171
)
7272
assert vcs_upload.uploadname == vcs["vcsName"]
73-
search_result = foss.search(
74-
searchType=SearchTypes.DIRECTORIES, filename=".git",
75-
)
73+
search_result = foss.search(searchType=SearchTypes.DIRECTORIES, filename=".git",)
7674
assert not search_result
7775
foss.delete_upload(vcs_upload)
7876

@@ -171,7 +169,10 @@ def test_upload_summary(foss: Fossology, scanned_upload: Upload):
171169
def test_upload_summary_nogroup(foss: Fossology, upload: Upload):
172170
with pytest.raises(AuthorizationError) as excinfo:
173171
foss.upload_summary(upload, group="test")
174-
assert f"Getting summary of upload {upload.id} for group test not authorized" in str(excinfo.value)
172+
assert (
173+
f"Getting summary of upload {upload.id} for group test not authorized"
174+
in str(excinfo.value)
175+
)
175176

176177

177178
def test_upload_licenses(foss: Fossology, scanned_upload: Upload):
@@ -198,7 +199,10 @@ def test_upload_licenses_from_agent(foss: Fossology, scanned_upload: Upload):
198199
def test_upload_licenses_nogroup(foss: Fossology, upload: Upload):
199200
with pytest.raises(AuthorizationError) as excinfo:
200201
foss.upload_licenses(upload, group="test")
201-
assert f"Getting license for upload {upload.id} for group test not authorized" in str(excinfo.value)
202+
assert (
203+
f"Getting license for upload {upload.id} for group test not authorized"
204+
in str(excinfo.value)
205+
)
202206

203207

204208
def test_delete_unknown_upload(foss: Fossology):
@@ -209,7 +213,7 @@ def test_delete_unknown_upload(foss: Fossology):
209213
"",
210214
"Non Upload",
211215
"2020-05-05",
212-
{"sha1": None, "md5": None, "sha256": None, "size": None}
216+
{"sha1": None, "md5": None, "sha256": None, "size": None},
213217
)
214218
with pytest.raises(FossologyApiError):
215219
foss.delete_upload(upload)
@@ -218,4 +222,6 @@ def test_delete_unknown_upload(foss: Fossology):
218222
def test_delete_upload_nogroup(foss: Fossology, upload: Upload):
219223
with pytest.raises(AuthorizationError) as excinfo:
220224
foss.delete_upload(upload, group="test")
221-
assert f"Deleting upload {upload.id} for group test not authorized" in str(excinfo.value)
225+
assert f"Deleting upload {upload.id} for group test not authorized" in str(
226+
excinfo.value
227+
)

0 commit comments

Comments
 (0)