def test_apply_service_template_kinesis_compressed(self): """StreamAlert CLI - TestEvent Apply Service Template, Kinesis Compressed""" event = basic_test_event_data(service='kinesis') event['compress'] = True kinesis_event = TestEvent(event) result = kinesis_event._apply_service_template(b'test') assert_equal(result['kinesis']['data'], b'eJwrSS0uAQAEXQHB')
def test_apply_defaults(self): """StreamAlert CLI - TestEvent Apply Defaults""" override_event = TestEvent( basic_test_event_data(override_data={'override': 'test'})) override_event._apply_defaults(self.basic_config()) # Ensure the right key was "overridden" assert_equal(override_event._event['data'], { 'default': '', 'override': 'test' })
def setup(self): # pylint: disable=attribute-defined-outside-init self._default_event = TestEvent(basic_test_event_data())
def test_apply_service_template_apps(self): """StreamAlert CLI - TestEvent Apply Service Template, App""" app_event = TestEvent(basic_test_event_data(service='streamalert_app')) result = app_event._apply_service_template('') assert_equal('streamalert_app' in result, True)
def test_apply_service_template_sns(self): """StreamAlert CLI - TestEvent Apply Service Template, SNS""" sns_event = TestEvent(basic_test_event_data(service='sns')) result = sns_event._apply_service_template('') assert_equal('Sns' in result, True)
def test_apply_service_template_kinesis(self): """StreamAlert CLI - TestEvent Apply Service Template, Kinesis""" kinesis_event = TestEvent(basic_test_event_data(service='kinesis')) result = kinesis_event._apply_service_template('') assert_equal('kinesis' in result, True)
def test_apply_service_template_s3(self): """StreamAlert CLI - TestEvent Apply Service Template, S3""" s3_event = TestEvent(basic_test_event_data(service='s3')) result = s3_event._apply_service_template('') assert_equal('s3' in result, True)
def _fake_result(self, passed): # pylint: disable=protected-access result = TestResult(0, basic_test_event_data()) result._classified_result = self._mock_classified_result( ) if passed else False return result