mentat.emails.test_event module

Unit test module for testing the mentat.emails.event module.

class mentat.emails.test_event.TestReportEmail(methodName='runTest')[source]

Bases: unittest.case.TestCase

Unit test class for testing the mentat.emails.event.ReportEmail class.

ideas_obj = [Idea({'Format': 'IDEA0', 'ConnCount': 2, 'Source': SourceList([SourceTargetDict({'IP4': Net4([IP4('188.14.166.39')])})]), 'Category': EventTag(['Attempt.Login']), 'WinStartTime': datetime.datetime(2016, 6, 21, 11, 55, 2), 'Description': 'SSH login attempt', 'Node': NodeList([NodeDict({'Name': 'cz.cesnet.mentat.warden_filer', 'Type': NodeTag(['Relay'])}), NodeDict({'SW': String(['Kippo']), 'Name': 'cz.uhk.apate.cowrie', 'AggrWin': datetime.timedelta(0, 300), 'Type': NodeTag(['Connection', 'Honeypot', 'Recon'])})]), 'Target': TargetList([SourceTargetDict({'Proto': ProtocolName(['tcp', 'ssh']), 'Port': Port([22]), 'IP4': Net4([IP4Net('195.113.165.128/25')]), 'Anonymised': True})]), 'DetectTime': datetime.datetime(2016, 6, 21, 13, 8, 27), '_CESNET': CESNETDict({'StorageTime': datetime.datetime(2016, 6, 21, 14, 0, 7)}), 'WinEndTime': datetime.datetime(2016, 6, 21, 12, 0, 2), 'ID': '4dd7cf5e-4a95-49f6-8f04-947de998012c'})]
ideas_raw = [{'Format': 'IDEA0', 'ConnCount': 2, 'Category': ['Attempt.Login'], 'Source': [{'IP4': ['188.14.166.39']}], 'WinStartTime': '2016-06-21T11:55:02Z', 'Description': 'SSH login attempt', 'Node': [{'Name': 'cz.cesnet.mentat.warden_filer', 'Type': ['Relay']}, {'SW': ['Kippo'], 'Name': 'cz.uhk.apate.cowrie', 'AggrWin': '00:05:00', 'Type': ['Connection', 'Honeypot', 'Recon']}], 'Target': [{'Proto': ['tcp', 'ssh'], 'Port': [22], 'IP4': ['195.113.165.128/25'], 'Anonymised': True}], 'DetectTime': '2016-06-21T13:08:27Z', '_CESNET': {'StorageTime': '2016-06-21T14:00:07Z'}, 'WinEndTime': '2016-06-21T12:00:02Z', 'ID': '4dd7cf5e-4a95-49f6-8f04-947de998012c'}]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_01_guess_attachment()[source]

Perform tests of guessing attachment mimetypes.

test_02_create_report()[source]

Perform the tests of generating basic report.