mirror of https://github.com/MISP/PyMISP
parent
2a0d6566ee
commit
45379a1158
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import url, key
|
from keys import url, key
|
||||||
|
@ -47,7 +48,7 @@ class TestBasic(unittest.TestCase):
|
||||||
u'Org': {u'name': u'ORGNAME'},
|
u'Org': {u'name': u'ORGNAME'},
|
||||||
u'Orgc': {u'name': u'ORGNAME'},
|
u'Orgc': {u'name': u'ORGNAME'},
|
||||||
u'threat_level_id': u'1'}}
|
u'threat_level_id': u'1'}}
|
||||||
print event
|
print(event)
|
||||||
self.assertEqual(event, to_check, 'Failed at creating a new Event')
|
self.assertEqual(event, to_check, 'Failed at creating a new Event')
|
||||||
return int(event_id)
|
return int(event_id)
|
||||||
|
|
||||||
|
@ -99,15 +100,15 @@ class TestBasic(unittest.TestCase):
|
||||||
|
|
||||||
def delete(self, eventid):
|
def delete(self, eventid):
|
||||||
event = self.misp.delete_event(eventid)
|
event = self.misp.delete_event(eventid)
|
||||||
print event.json()
|
print(event.json())
|
||||||
|
|
||||||
def delete_attr(self, attrid):
|
def delete_attr(self, attrid):
|
||||||
event = self.misp.delete_attribute(attrid)
|
event = self.misp.delete_attribute(attrid)
|
||||||
print event.json()
|
print(event.json())
|
||||||
|
|
||||||
def get(self, eventid):
|
def get(self, eventid):
|
||||||
event = self.misp.get_event(eventid)
|
event = self.misp.get_event(eventid)
|
||||||
print event.json()
|
print(event.json())
|
||||||
|
|
||||||
def get_stix(self, **kwargs):
|
def get_stix(self, **kwargs):
|
||||||
event = self.misp.get_stix(kwargs)
|
event = self.misp.get_stix(kwargs)
|
||||||
|
@ -129,7 +130,7 @@ class TestBasic(unittest.TestCase):
|
||||||
u'ShadowAttribute': [], u'distribution': u'2', u'type': u'filename|sha256'}],
|
u'ShadowAttribute': [], u'distribution': u'2', u'type': u'filename|sha256'}],
|
||||||
u'proposal_email_lock': False, u'threat_level_id': u'1'}}
|
u'proposal_email_lock': False, u'threat_level_id': u'1'}}
|
||||||
event = self.misp.add_event(event)
|
event = self.misp.add_event(event)
|
||||||
print event.json()
|
print(event.json())
|
||||||
|
|
||||||
def test_create_event(self):
|
def test_create_event(self):
|
||||||
eventid = self.new_event()
|
eventid = self.new_event()
|
||||||
|
|
Loading…
Reference in New Issue