Skip to content

Commit

Permalink
Fixed ExtendedIncident
Browse files Browse the repository at this point in the history
Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
  • Loading branch information
JonahSussman committed Jul 21, 2024
1 parent 31418d1 commit 76d8d62
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions kai/models/report_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ class ExtendedIncident(Incident):
"""

ruleset_name: str
ruleset_description: Optional[str]
ruleset_description: Optional[str] = None
violation_name: str
violation_description: Optional[str]
violation_description: Optional[str] = None


# Link defines an external hyperlink
Expand Down
20 changes: 11 additions & 9 deletions tests/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import pprint
import unittest

from kai.models.report_types import ExtendedIncident
from kai.report import Report


Expand Down Expand Up @@ -36,15 +37,16 @@ def test_impacted_files(self):
self.assertTrue(test_file_entry in impacted_files)
test_entry = impacted_files[test_file_entry]
self.assertTrue(len(test_entry) == 6)
self.assertTrue("violation_name" in test_entry[0].keys())
self.assertTrue("violation_description" in test_entry[0].keys())
self.assertTrue("ruleset_name" in test_entry[0].keys())
self.assertTrue("ruleset_description" in test_entry[0].keys())
self.assertTrue("message" in test_entry[0].keys())
self.assertTrue("variables" in test_entry[0].keys())
self.assertTrue("file" in test_entry[0]["variables"].keys())
self.assertTrue("kind" in test_entry[0]["variables"].keys())
self.assertTrue("name" in test_entry[0]["variables"].keys())
self.assertTrue(isinstance(test_entry[0], ExtendedIncident))
# self.assertTrue("violation_name" in test_entry[0].keys())
# self.assertTrue("violation_description" in test_entry[0].keys())
# self.assertTrue("ruleset_name" in test_entry[0].keys())
# self.assertTrue("ruleset_description" in test_entry[0].keys())
# self.assertTrue("message" in test_entry[0].keys())
# self.assertTrue("variables" in test_entry[0].keys())
# self.assertTrue("file" in test_entry[0]["variables"].keys())
# self.assertTrue("kind" in test_entry[0]["variables"].keys())
# self.assertTrue("name" in test_entry[0]["variables"].keys())


if __name__ == "__main__":
Expand Down

0 comments on commit 76d8d62

Please sign in to comment.