Skip to content

Commit a0bda87

Browse files
committed
chg: Add test case, fix mypy
1 parent 59946a6 commit a0bda87

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pymisp/mispevent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ class MISPOrganisation(AbstractMISP):
112112
def __init__(self):
113113
super().__init__()
114114
self.id: int
115+
self.name: str
115116

116117
def from_dict(self, **kwargs):
117118
if 'Organisation' in kwargs:

tests/testlive_comprehensive.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2453,7 +2453,7 @@ def test_first_last_seen(self):
24532453
event.info = 'Test First Last seen'
24542454
event.add_attribute('ip-dst', '8.8.8.8', first_seen='2020-01-04', last_seen='2020-01-04T12:30:34.323242+0800')
24552455
obj = event.add_object(name='file', first_seen=1580147259.268763, last_seen=1580147300)
2456-
attr = obj.add_attribute('filename', 'blah.exe')
2456+
attr = obj.add_attribute('filename', 'blah.exe', comment="blah")
24572457
attr.first_seen = '2022-01-30'
24582458
attr.last_seen = '2022-02-23'
24592459
try:
@@ -2463,6 +2463,8 @@ def test_first_last_seen(self):
24632463
self.assertEqual(first.attributes[0].last_seen, datetime(2020, 1, 4, 4, 30, 34, 323242, tzinfo=timezone.utc))
24642464

24652465
# Object
2466+
self.assertEqual(first.objects[0].attributes[0].value, 'blah.exe')
2467+
self.assertEqual(first.objects[0].attributes[0].comment, 'blah')
24662468
self.assertEqual(first.objects[0].first_seen, datetime(2020, 1, 27, 17, 47, 39, 268763, tzinfo=timezone.utc))
24672469
self.assertEqual(first.objects[0].last_seen, datetime(2020, 1, 27, 17, 48, 20, tzinfo=timezone.utc))
24682470

0 commit comments

Comments
 (0)