Browse Source

fix: Fixed ipasn test input format + module version updated

pull/363/head
chrisr3d 2 years ago
parent
commit
31a74a10c1
No known key found for this signature in database GPG Key ID: 6BBED1B63A6D639F
  1. 2
      misp_modules/modules/expansion/ipasn.py
  2. 5
      tests/test_expansions.py

2
misp_modules/modules/expansion/ipasn.py

@ -6,7 +6,7 @@ from pymisp import MISPAttribute, MISPEvent, MISPObject
misperrors = {'error': 'Error'}
mispattributes = {'input': ['ip-src', 'ip-dst'], 'format': 'misp_standard'}
moduleinfo = {'version': '0.1', 'author': 'Raphaël Vinot',
moduleinfo = {'version': '0.2', 'author': 'Raphaël Vinot',
'description': 'Query an IP ASN history service (https://github.com/CIRCL/IP-ASN-history.git)',
'module-type': ['expansion', 'hover']}

5
tests/test_expansions.py

@ -235,7 +235,10 @@ class TestExpansions(unittest.TestCase):
self.assertTrue(value.startswith('{"ip":"1.1.1.1","status":"ok"'))
def test_ipasn(self):
query = {"module": "ipasn", "ip-dst": "1.1.1.1"}
query = {"module": "ipasn",
"attribute": {"type": "ip-src",
"value": "149.13.33.14",
"uuid": "ea89a33b-4ab7-4515-9f02-922a0bee333d"}}
response = self.misp_modules_post(query)
self.assertEqual(self.get_object(response), 'asn')

Loading…
Cancel
Save