Skip to content

Commit 265110c

Browse files
style: format code with Black
This commit fixes the style issues introduced in 492c3a1 according to the output from Black. Details: #18
1 parent 492c3a1 commit 265110c

3 files changed

Lines changed: 21 additions & 10 deletions

File tree

codeinsight_sdk/handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import abc
22
from typing import List
33

4+
45
class Handler(abc.ABC):
56
def __init__(self, client):
67
self.client = client
@@ -9,4 +10,3 @@ def __init__(self, client):
910
@abc.abstractmethod
1011
def get(self):
1112
pass
12-

tests/test_experimental.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212
TEST_URL = "https://api.revenera.com"
1313
TEST_API_TOKEN = "your_api_token"
1414

15+
1516
class TestExperimental:
1617
@pytest.fixture
1718
def client(self):
1819
return CodeInsightClient(TEST_URL, TEST_API_TOKEN, experimental=True)
19-
20+
2021
def test_experimental_enabled(self, client):
2122
assert client.experimental_enabled == True
22-
23+
2324
def test_get_project_vulnerabilities(self, client):
2425
project_id = 1
2526
total_pages = 4
@@ -85,11 +86,21 @@ def test_get_project_vulnerabilities(self, client):
8586
"vulnerabilityCvssV3Severity":"CRITICAL"} ] }
8687
"""
8788
with requests_mock.Mocker() as m:
88-
m.get(f"{TEST_URL}/codeinsight/api/projects/{project_id}/inventorySummary",
89-
text=fake_response_json, headers=response_header)
90-
m.get(f"{TEST_URL}/codeinsight/api/inventories/12346/vulnerabilities",
91-
text=mock_resp_vuln, headers=response_header)
92-
vulnerable_items = client.experimental.get_project_vulnerabilities(project_id)
89+
m.get(
90+
f"{TEST_URL}/codeinsight/api/projects/{project_id}/inventorySummary",
91+
text=fake_response_json,
92+
headers=response_header,
93+
)
94+
m.get(
95+
f"{TEST_URL}/codeinsight/api/inventories/12346/vulnerabilities",
96+
text=mock_resp_vuln,
97+
headers=response_header,
98+
)
99+
vulnerable_items = client.experimental.get_project_vulnerabilities(
100+
project_id
101+
)
93102
assert len(vulnerable_items) > 0
94103
assert vulnerable_items[0].vulnerabilities is not None
95-
assert vulnerable_items[0].vulnerabilities[1].vulnerabilityName == "CVE-987-65432"
104+
assert (
105+
vulnerable_items[0].vulnerabilities[1].vulnerabilityName == "CVE-987-65432"
106+
)

tests/test_handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
class TestHandlers(object):
77
@pytest.fixture
88
def client(self):
9-
return CodeInsightClient("","")
9+
return CodeInsightClient("", "")

0 commit comments

Comments
 (0)