Proper testcases

pull/28/head
Raphaël Vinot 2016-06-18 14:53:26 +09:00
parent 0752c5e3f4
commit ef6e3b27f8
3 changed files with 31 additions and 4 deletions

View File

@ -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 Normal file
View File

26
tests/test.py Executable file
View File

@ -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())