add: Added qrcode module test with its test image

pull/347/head
chrisr3d 2019-10-31 11:46:11 +01:00
parent 3277a23d92
commit 969d8b627d
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
2 changed files with 8 additions and 0 deletions

View File

@ -294,6 +294,14 @@ class TestExpansions(unittest.TestCase):
response = self.misp_modules_post(query) response = self.misp_modules_post(query)
self.assertEqual(self.get_values(response), '\npptx test\n') self.assertEqual(self.get_values(response), '\npptx test\n')
def test_qrcode(self):
filename = 'qrcode.jpeg'
with open(f'{self.dirname}/test_files/{filename}', 'rb') as f:
encoded = b64encode(f.read()).decode()
query = {"module": "qrcode", "attachment": filename, "data": encoded}
response = self.misp_modules_post(query)
self.assertEqual(self.get_values(response), '1GXZ6v7FZzYBEnoRaG77SJxhu7QkvQmFuh')
def test_rbl(self): def test_rbl(self):
query = {"module": "rbl", "ip-src": "8.8.8.8"} query = {"module": "rbl", "ip-src": "8.8.8.8"}
response = self.misp_modules_post(query) response = self.misp_modules_post(query)

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB