Skip to content

Commit

Permalink
Increasing test case to complete the pre-commit check
Browse files Browse the repository at this point in the history
  • Loading branch information
sudhanshu-metron committed Oct 30, 2024
1 parent db5486c commit 53a8606
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions Packs/Cybereason/Integrations/Cybereason/Cybereason_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,56 @@ def test_malop_to_incident_6(mocker):
assert exc_info.match(r"Cybereason raw response is not valid")


def test_malop_to_incident_7(mocker):
from Cybereason import malop_to_incident
args = {
"guidString": "12345B",
"simpleValues": {
"detectionType": {
"values": [
"ABCD"
]
},
"creationTime": {
"values": [
"1721"
]
},
"malopLastUpdateTime": {
"values": [
"17280"
]
},
"managementStatus": {
"values": ["REOPEN"]
}
},
"elementValues": {
"rootCauseElements": {
"elementValues": [
{
"elementType": "ABCD",
"name": "fileName"
}
]
}
}
}
command_output = malop_to_incident(args)

assert all([(command_output['name'] == "Cybereason Malop 12345B"), (command_output['status'] == 0),
(command_output['CustomFields']['malopcreationtime'] == "1721"),
(command_output['CustomFields']['malopupdatetime'] == "17280"),
(command_output['CustomFields']['malopdetectiontype'] == "ABCD"),
(command_output['CustomFields']['maloprootcauseelementname'] == "fileName"),
(command_output['CustomFields']['maloprootcauseelementtype'] == "ABCD"),
(command_output['CustomFields']['malopedr']), (command_output['dbotmirrorid'] == "12345B")])

with pytest.raises(Exception) as exc_info:
command_output = malop_to_incident("args")
assert exc_info.match(r"Cybereason raw response is not valid")


def test_get_pylum_id(mocker):
from Cybereason import get_pylum_id, Client
HEADERS = {'Content-Type': 'application/json', 'Connection': 'close'}
Expand Down

0 comments on commit 53a8606

Please sign in to comment.