diff --git a/.travis.yml b/.travis.yml index d9d892fa..abef1f57 100644 --- a/.travis.yml +++ b/.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 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test.py b/tests/test.py new file mode 100755 index 00000000..47323589 --- /dev/null +++ b/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())