Browse Source

add: Added qrcode module test with its test image

pull/347/head
chrisr3d 2 years ago
parent
commit
969d8b627d
No known key found for this signature in database GPG Key ID: 6BBED1B63A6D639F
  1. 8
      tests/test_expansions.py
  2. BIN
      tests/test_files/qrcode.jpeg

8
tests/test_expansions.py

@ -294,6 +294,14 @@ class TestExpansions(unittest.TestCase):
response = self.misp_modules_post(query)
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):
query = {"module": "rbl", "ip-src": "8.8.8.8"}
response = self.misp_modules_post(query)

BIN
tests/test_files/qrcode.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Loading…
Cancel
Save