Skip to content

Commit 1fedcfd

Browse files
committed
Formatting
1 parent 6aec34b commit 1fedcfd

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

sonar/branches.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ def delete(self) -> bool:
176176
log.warning(e.message)
177177
return False
178178

179-
def get(self, api: str, params: types.ApiParams = None, data: Optional[str] = None, mute: tuple[HTTPStatus] = (), **kwargs: str) -> requests.Response:
179+
def get(
180+
self, api: str, params: types.ApiParams = None, data: Optional[str] = None, mute: tuple[HTTPStatus] = (), **kwargs: str
181+
) -> requests.Response:
180182
"""Performs an HTTP GET request for the object"""
181183
try:
182184
return super().get(api=api, params=params, data=data, mute=mute, **kwargs)

test/unit/test_findings_sync.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636

3737
CMD = "sonar-findings-sync.py"
3838

39-
TEST_URL = os.getenv('SONAR_HOST_URL_TEST')
40-
TEST_TOKEN = os.getenv('SONAR_TOKEN_SYNC_USER')
39+
TEST_URL = os.getenv("SONAR_HOST_URL_TEST")
40+
TEST_TOKEN = os.getenv("SONAR_TOKEN_SYNC_USER")
4141
PLAT_OPTS = f"{tutil.SQS_OPTS} --{opt.URL_TARGET} {TEST_URL} --{opt.TOKEN_TARGET} {TEST_TOKEN}"
4242
TEST_OPTS = f"--{opt.URL} {TEST_URL} --{opt.TOKEN} {TEST_TOKEN} --{opt.KEY_REGEXP} TESTSYNC"
4343
SC_PLAT_OPTS = f"{tutil.SQS_OPTS} -U https://sonarcloud.io -T {os.getenv('SONAR_TOKEN_SONARCLOUD')} -O okorach"
@@ -53,6 +53,7 @@ def test_sync_2_proj_all_branches(json_file: Generator[str]) -> None:
5353
"""test_sync_2_proj"""
5454
assert tutil.run_cmd(findings_sync.main, f"{CMD} {PLAT_OPTS} {SYNC_OPTS} -{opt.REPORT_FILE_SHORT} {json_file}") == e.OK
5555

56+
5657
def test_sync_same_proj_all_branches(json_file: Generator[str]) -> None:
5758
"""test_sync_same_proj_all_branches"""
5859
# Project sync across all branches of a given project
@@ -67,7 +68,10 @@ def test_sync_same_proj_2_branches(json_file: Generator[str]) -> None:
6768
def test_sync_2_proj_branches(json_file: Generator[str]) -> None:
6869
"""test_sync_2_proj_branches"""
6970
code = e.UNSUPPORTED_OPERATION if tutil.SQ.edition() == c.CE else e.OK
70-
assert tutil.run_cmd(findings_sync.main, f"{CMD} {PLAT_OPTS} {SYNC_OPTS} --{opt.BRANCH_REGEXP} master -B main -{opt.REPORT_FILE_SHORT} {json_file}") == code
71+
assert (
72+
tutil.run_cmd(findings_sync.main, f"{CMD} {PLAT_OPTS} {SYNC_OPTS} --{opt.BRANCH_REGEXP} master -B main -{opt.REPORT_FILE_SHORT} {json_file}")
73+
== code
74+
)
7175
if tutil.SQ.edition() == c.CE:
7276
assert tutil.run_cmd(findings_sync.main, f"{CMD} {PLAT_OPTS} {SYNC_OPTS} -B main -{opt.REPORT_FILE_SHORT} {json_file}") == e.OK
7377

test/unit/test_projects.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ def test_import_sync() -> None:
131131
else:
132132
assert proj.import_zip(asynchronous=False).startswith("FAILED")
133133

134+
134135
def test_import_no_zip(get_test_project: Generator[projects.Project]) -> None:
135136
"""test_import_no_zip"""
136137
if tutil.SQ.edition() == c.CE:
@@ -140,6 +141,7 @@ def test_import_no_zip(get_test_project: Generator[projects.Project]) -> None:
140141
res = get_test_project.import_zip(asynchronous=False)
141142
assert res.startsWith("FAILED/") and "not found" in res
142143

144+
143145
def test_monorepo() -> None:
144146
"""test_monorepo"""
145147
proj = projects.Project.get_object(endpoint=tutil.SQ, key=tutil.LIVE_PROJECT)
@@ -211,10 +213,12 @@ def test_already_exists() -> None:
211213
with pytest.raises(exceptions.ObjectAlreadyExists):
212214
projects.Project.create(endpoint=tutil.SQ, key=tutil.EXISTING_PROJECT, name="name")
213215

216+
214217
def test_exists() -> None:
215218
assert projects.exists(tutil.SQ, tutil.LIVE_PROJECT)
216219
assert not projects.exists(tutil.SQ, "non-existing")
217220

221+
218222
def test_binding() -> None:
219223
"""test_binding"""
220224
if tutil.SQ.edition() == c.CE:

0 commit comments

Comments
 (0)