-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added unit tests for IDS Alert type. verified IDS alert existence #419
added unit tests for IDS Alert type. verified IDS alert existence #419
Conversation
cbcsdk_mock.mock_request('POST', "/api/alerts/v7/orgs/test/alerts/_search", on_post) | ||
api = cbcsdk_mock.api | ||
|
||
query = api.select(Alert).where("Blort").add_criteria("type", ["INTRUSION_DETECTION_SYSTEM"])\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two additional tests - instantiate class, and class as string - select("IntrusionDetectionSystemAlert")
request = self._build_request(0, -1, False) | ||
del request['rows'] | ||
request["terms"] = {"fields": fieldlist, "rows": max_rows} | ||
url = self._build_url("/_facet") | ||
resp = self._cb.post_object(url, body=request) | ||
if resp.status_code == 400: | ||
raise ApiError(resp.json()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think post_object
is returning a json, is it correct to do resp.json()
?
* added unit tests for IDS Alert type. verified IDS alert existence * Added dependent fix for CBAPI-5061 and related tests.
Pull request checklist
Please check if your PR fulfills the following requirements:
What is the ticket or issue number?
CPAPI-4812
CPAPI-5061
Pull Request Description
Added unit tests for IDS alerts
Added new unit tests for decomissioned functionality
Does this introduce a breaking change?
How Has This Been Tested?
manual tests and unit tests