Skip to content

Commit

Permalink
new Add test for ASNObject
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Apr 11, 2019
1 parent c37eabd commit e8334be
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/testlive_comprehensive.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

try:
from pymisp import ExpandedPyMISP, MISPEvent, MISPOrganisation, MISPUser, Distribution, ThreatLevel, Analysis, MISPObject
from pymisp.tools import CSVLoader, DomainIPObject
from pymisp.tools import CSVLoader, DomainIPObject, ASNObject
except ImportError:
if sys.version_info < (3, 6):
print('This test suite requires Python 3.6+, breaking.')
Expand Down Expand Up @@ -957,6 +957,19 @@ def test_domain_ip_object(self):
# Delete event
self.admin_misp_connector.delete_event(first.id)

def test_asn_object(self):
first = self.create_simple_event()
try:
dom_ip_obj = ASNObject({'asn': '12345',
'first-seen': '20190101',
'last-seen': '2019-02-03'})
first.add_object(dom_ip_obj)
first = self.user_misp_connector.add_event(first)
self.assertEqual(len(first.objects[0].attributes), 3)
finally:
# Delete event
self.admin_misp_connector.delete_event(first.id)

def test_object_template(self):
r = self.admin_misp_connector.update_object_templates()
self.assertEqual(type(r), list)
Expand Down

0 comments on commit e8334be

Please sign in to comment.