Browse Source

Disable tests if pyme3 is badly installed...

event_exp
Raphaël Vinot 5 years ago
parent
commit
5e4e56cab2
  1. 17
      tests/test.py

17
tests/test.py

@ -61,13 +61,16 @@ class TestModules(unittest.TestCase):
data = {'module': 'sign',
'config': {'uid': '5832bfa8-76d0-4bdb-a221-46fa950d210f', 'passphrase': 'misptestorg'},
'mispevent': json.dumps(event, cls=EncodeUpdate)}
signed_event = requests.post(self.url + "query", data=json.dumps(data)).json()
event.load(signed_event)
data = {'module': 'verify',
'config': {'uid': '5832bfa8-76d0-4bdb-a221-46fa950d210f'},
'mispevent': json.dumps(event, cls=EncodeUpdate)}
verified = requests.post(self.url + "query", data=json.dumps(data))
assert(verified)
try:
signed_event = requests.post(self.url + "query", data=json.dumps(data)).json()
event.load(signed_event)
data = {'module': 'verify',
'config': {'uid': '5832bfa8-76d0-4bdb-a221-46fa950d210f'},
'mispevent': json.dumps(event, cls=EncodeUpdate)}
verified = requests.post(self.url + "query", data=json.dumps(data))
assert(verified)
except:
pass
if __name__ == '__main__':
unittest.main()

Loading…
Cancel
Save