-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
931 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from pathlib import Path | ||
|
||
from TestSuite.json_based import JSONBased | ||
|
||
|
||
class CaseField(JSONBased): | ||
def __init__(self, name: str, case_field_dir_path: Path, json_content: dict = None): | ||
self.case_field_file_path = case_field_dir_path / f"{name}.json" | ||
super().__init__( | ||
dir_path=case_field_dir_path, | ||
name=name, | ||
prefix="casefield", | ||
json_content=json_content, | ||
) | ||
|
||
def create_default(self): | ||
self.write_json( | ||
{ | ||
"id": self.id, | ||
"description": "test description", | ||
"cliName": self.id.lower(), | ||
"name": self.id, | ||
"associatedToAll": False, | ||
"type": "shortText", | ||
"associatedTypes": [], | ||
"threshold": 72, | ||
"fromVersion": "8.7.0", | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from pathlib import Path | ||
|
||
from TestSuite.json_based import JSONBased | ||
|
||
|
||
class CaseLayout(JSONBased): | ||
def __init__( | ||
self, name: str, case_layout_dir_path: Path, json_content: dict = None | ||
): | ||
self.case_layout_tmp_path = case_layout_dir_path / f"{name}.json" | ||
super().__init__( | ||
dir_path=case_layout_dir_path, | ||
name=name, | ||
prefix="layoutcontainer", | ||
json_content=json_content, | ||
) | ||
|
||
def create_default(self): | ||
self.write_json( | ||
{ | ||
"detailsV2": { | ||
"tabs": [ | ||
{"id": "overview", "name": "Overview", "type": "overview"}, | ||
{ | ||
"id": "alerts_and_insights", | ||
"name": "Alerts \u0026 Insights", | ||
"type": "alertInsights", | ||
}, | ||
{"id": "timeline", "name": "Timeline", "type": "timeline"}, | ||
{ | ||
"id": "executions", | ||
"name": "Executions", | ||
"type": "executions", | ||
}, | ||
] | ||
}, | ||
"group": "case", | ||
"id": self.id, | ||
"name": self.id, | ||
"system": False, | ||
"version": -1, | ||
"fromVersion": "8.7.0", | ||
"description": "", | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from pathlib import Path | ||
|
||
from TestSuite.json_based import JSONBased | ||
|
||
|
||
class CaseLayoutRule(JSONBased): | ||
def __init__( | ||
self, name: str, case_layout_rule_dir_path: Path, json_content: dict = None | ||
): | ||
self.layout_rule_tmp_path = case_layout_rule_dir_path / f"{name}.json" | ||
self.name = name | ||
self.rule_id = name | ||
|
||
super().__init__(dir_path=case_layout_rule_dir_path, name=name, prefix="") | ||
|
||
if json_content: | ||
self.write_json(json_content) | ||
else: | ||
self.create_default_case_layout_rule() | ||
|
||
def create_default_case_layout_rule(self): | ||
self.write_json( | ||
{ | ||
"rule_id": self.rule_id, | ||
"rule_name": self.rule_id, | ||
"layout_id": "test_layout", | ||
"description": "", | ||
"incidents_filter": { | ||
"filter": { | ||
"AND": [ | ||
{ | ||
"SEARCH_FIELD": "STATUS", | ||
"SEARCH_TYPE": "NEQ", | ||
"SEARCH_VALUE": "STATUS_030_RESOLVED_THREAT_HANDLED", | ||
} | ||
] | ||
} | ||
}, | ||
"fromVersion": "8.7.0", | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.