From a0bda8736a2fdf6b29ba904bc820e21890a26bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Fri, 5 Mar 2021 12:11:00 +0100 Subject: [PATCH] chg: Add test case, fix mypy --- pymisp/mispevent.py | 1 + tests/testlive_comprehensive.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index d5a5d5b..5117334 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -112,6 +112,7 @@ class MISPOrganisation(AbstractMISP): def __init__(self): super().__init__() self.id: int + self.name: str def from_dict(self, **kwargs): if 'Organisation' in kwargs: diff --git a/tests/testlive_comprehensive.py b/tests/testlive_comprehensive.py index 98ff851..bb65451 100644 --- a/tests/testlive_comprehensive.py +++ b/tests/testlive_comprehensive.py @@ -2453,7 +2453,7 @@ class TestComprehensive(unittest.TestCase): event.info = 'Test First Last seen' event.add_attribute('ip-dst', '8.8.8.8', first_seen='2020-01-04', last_seen='2020-01-04T12:30:34.323242+0800') obj = event.add_object(name='file', first_seen=1580147259.268763, last_seen=1580147300) - attr = obj.add_attribute('filename', 'blah.exe') + attr = obj.add_attribute('filename', 'blah.exe', comment="blah") attr.first_seen = '2022-01-30' attr.last_seen = '2022-02-23' try: @@ -2463,6 +2463,8 @@ class TestComprehensive(unittest.TestCase): self.assertEqual(first.attributes[0].last_seen, datetime(2020, 1, 4, 4, 30, 34, 323242, tzinfo=timezone.utc)) # Object + self.assertEqual(first.objects[0].attributes[0].value, 'blah.exe') + self.assertEqual(first.objects[0].attributes[0].comment, 'blah') self.assertEqual(first.objects[0].first_seen, datetime(2020, 1, 27, 17, 47, 39, 268763, tzinfo=timezone.utc)) self.assertEqual(first.objects[0].last_seen, datetime(2020, 1, 27, 17, 48, 20, tzinfo=timezone.utc))