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