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