Browse Source

Proper testcases

pull/28/head
Raphaël Vinot 6 years ago
parent
commit
ef6e3b27f8
  1. 9
      .travis.yml
  2. 0
      tests/__init__.py
  3. 26
      tests/test.py

9
.travis.yml

@ -17,9 +17,10 @@ python:
- "nightly"
install:
- pip install -r REQUIREMENTS
- python setup.py install
script:
- pushd bin
- ./misp-modules.py -t
- popd
- misp-modules.py &
- sleep 15
- python setup.py test
- pkill misp-modules.py

0
tests/__init__.py

26
tests/test.py

@ -0,0 +1,26 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import requests
class TestModules(unittest.TestCase):
def setUp(self):
self.maxDiff = None
self.headers = {'Content-Type': 'application/json'}
def test_introspection(self):
response = requests.get('http://127.0.0.1:6666/modules')
print(response.json())
def test_cve(self):
with open('tests/bodycve.json', 'r') as f:
response = requests.post('http://127.0.0.1:6666/query', data=f.read())
print(response.json())
def test_dns(self):
with open('tests/body.json', 'r') as f:
response = requests.post('http://127.0.0.1:6666/query', data=f.read())
print(response.json())
Loading…
Cancel
Save