Skip to content

Commit f5a9c7f

Browse files
committed
fix(FindingsAPI): getOccurrence should not return list
1 parent 95e33e2 commit f5a9c7f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ibm_scc/findings_v1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ def get_occurrence(self,
960960
UUID v4 format.
961961
:param dict headers: A `dict` containing the request headers
962962
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
963-
:rtype: DetailedResponse with `dict` result representing a `ApiListOccurrencesResponse` object
963+
:rtype: DetailedResponse with `dict` result representing a `ApiOccurrence` object
964964
"""
965965

966966
if provider_id is None:

test/unit/test_findings_v1.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2414,7 +2414,7 @@ def test_get_occurrence_all_params(self):
24142414
"""
24152415
# Set up mock
24162416
url = self.preprocess_url(_base_url + '/v1/testString/providers/testString/occurrences/testString')
2417-
mock_response = '{"occurrences": [{"resource_url": "resource_url", "note_name": "note_name", "kind": "FINDING", "remediation": "remediation", "create_time": "2019-01-01T12:00:00.000Z", "update_time": "2019-01-01T12:00:00.000Z", "id": "id", "context": {"region": "region", "resource_crn": "resource_crn", "resource_id": "resource_id", "resource_name": "resource_name", "resource_type": "resource_type", "service_crn": "service_crn", "service_name": "service_name", "environment_name": "environment_name", "component_name": "component_name", "toolchain_id": "toolchain_id"}, "finding": {"severity": "LOW", "certainty": "LOW", "next_steps": [{"title": "title", "url": "url"}], "network_connection": {"direction": "direction", "protocol": "protocol", "client": {"address": "address", "port": 4}, "server": {"address": "address", "port": 4}}, "data_transferred": {"client_bytes": 12, "server_bytes": 12, "client_packets": 14, "server_packets": 14}}, "kpi": {"value": 5, "total": 5}, "reference_data": {"anyKey": "anyValue"}}], "next_page_token": "next_page_token"}'
2417+
mock_response = '{"resource_url": "resource_url", "note_name": "note_name", "kind": "FINDING", "remediation": "remediation", "create_time": "2019-01-01T12:00:00.000Z", "update_time": "2019-01-01T12:00:00.000Z", "id": "id", "context": {"region": "region", "resource_crn": "resource_crn", "resource_id": "resource_id", "resource_name": "resource_name", "resource_type": "resource_type", "service_crn": "service_crn", "service_name": "service_name", "environment_name": "environment_name", "component_name": "component_name", "toolchain_id": "toolchain_id"}, "finding": {"severity": "LOW", "certainty": "LOW", "next_steps": [{"title": "title", "url": "url"}], "network_connection": {"direction": "direction", "protocol": "protocol", "client": {"address": "address", "port": 4}, "server": {"address": "address", "port": 4}}, "data_transferred": {"client_bytes": 12, "server_bytes": 12, "client_packets": 14, "server_packets": 14}}, "kpi": {"value": 5, "total": 5}, "reference_data": {"anyKey": "anyValue"}}'
24182418
responses.add(responses.GET,
24192419
url,
24202420
body=mock_response,
@@ -2454,7 +2454,7 @@ def test_get_occurrence_required_params(self):
24542454
"""
24552455
# Set up mock
24562456
url = self.preprocess_url(_base_url + '/v1/testString/providers/testString/occurrences/testString')
2457-
mock_response = '{"occurrences": [{"resource_url": "resource_url", "note_name": "note_name", "kind": "FINDING", "remediation": "remediation", "create_time": "2019-01-01T12:00:00.000Z", "update_time": "2019-01-01T12:00:00.000Z", "id": "id", "context": {"region": "region", "resource_crn": "resource_crn", "resource_id": "resource_id", "resource_name": "resource_name", "resource_type": "resource_type", "service_crn": "service_crn", "service_name": "service_name", "environment_name": "environment_name", "component_name": "component_name", "toolchain_id": "toolchain_id"}, "finding": {"severity": "LOW", "certainty": "LOW", "next_steps": [{"title": "title", "url": "url"}], "network_connection": {"direction": "direction", "protocol": "protocol", "client": {"address": "address", "port": 4}, "server": {"address": "address", "port": 4}}, "data_transferred": {"client_bytes": 12, "server_bytes": 12, "client_packets": 14, "server_packets": 14}}, "kpi": {"value": 5, "total": 5}, "reference_data": {"anyKey": "anyValue"}}], "next_page_token": "next_page_token"}'
2457+
mock_response = '{"resource_url": "resource_url", "note_name": "note_name", "kind": "FINDING", "remediation": "remediation", "create_time": "2019-01-01T12:00:00.000Z", "update_time": "2019-01-01T12:00:00.000Z", "id": "id", "context": {"region": "region", "resource_crn": "resource_crn", "resource_id": "resource_id", "resource_name": "resource_name", "resource_type": "resource_type", "service_crn": "service_crn", "service_name": "service_name", "environment_name": "environment_name", "component_name": "component_name", "toolchain_id": "toolchain_id"}, "finding": {"severity": "LOW", "certainty": "LOW", "next_steps": [{"title": "title", "url": "url"}], "network_connection": {"direction": "direction", "protocol": "protocol", "client": {"address": "address", "port": 4}, "server": {"address": "address", "port": 4}}, "data_transferred": {"client_bytes": 12, "server_bytes": 12, "client_packets": 14, "server_packets": 14}}, "kpi": {"value": 5, "total": 5}, "reference_data": {"anyKey": "anyValue"}}'
24582458
responses.add(responses.GET,
24592459
url,
24602460
body=mock_response,
@@ -2492,7 +2492,7 @@ def test_get_occurrence_value_error(self):
24922492
"""
24932493
# Set up mock
24942494
url = self.preprocess_url(_base_url + '/v1/testString/providers/testString/occurrences/testString')
2495-
mock_response = '{"occurrences": [{"resource_url": "resource_url", "note_name": "note_name", "kind": "FINDING", "remediation": "remediation", "create_time": "2019-01-01T12:00:00.000Z", "update_time": "2019-01-01T12:00:00.000Z", "id": "id", "context": {"region": "region", "resource_crn": "resource_crn", "resource_id": "resource_id", "resource_name": "resource_name", "resource_type": "resource_type", "service_crn": "service_crn", "service_name": "service_name", "environment_name": "environment_name", "component_name": "component_name", "toolchain_id": "toolchain_id"}, "finding": {"severity": "LOW", "certainty": "LOW", "next_steps": [{"title": "title", "url": "url"}], "network_connection": {"direction": "direction", "protocol": "protocol", "client": {"address": "address", "port": 4}, "server": {"address": "address", "port": 4}}, "data_transferred": {"client_bytes": 12, "server_bytes": 12, "client_packets": 14, "server_packets": 14}}, "kpi": {"value": 5, "total": 5}, "reference_data": {"anyKey": "anyValue"}}], "next_page_token": "next_page_token"}'
2495+
mock_response = '{"resource_url": "resource_url", "note_name": "note_name", "kind": "FINDING", "remediation": "remediation", "create_time": "2019-01-01T12:00:00.000Z", "update_time": "2019-01-01T12:00:00.000Z", "id": "id", "context": {"region": "region", "resource_crn": "resource_crn", "resource_id": "resource_id", "resource_name": "resource_name", "resource_type": "resource_type", "service_crn": "service_crn", "service_name": "service_name", "environment_name": "environment_name", "component_name": "component_name", "toolchain_id": "toolchain_id"}, "finding": {"severity": "LOW", "certainty": "LOW", "next_steps": [{"title": "title", "url": "url"}], "network_connection": {"direction": "direction", "protocol": "protocol", "client": {"address": "address", "port": 4}, "server": {"address": "address", "port": 4}}, "data_transferred": {"client_bytes": 12, "server_bytes": 12, "client_packets": 14, "server_packets": 14}}, "kpi": {"value": 5, "total": 5}, "reference_data": {"anyKey": "anyValue"}}'
24962496
responses.add(responses.GET,
24972497
url,
24982498
body=mock_response,

0 commit comments

Comments
 (0)