예제 #1
0
    def test_validate_schema_all(self):
        """ParserBase - Validate Schema, All Options"""
        options = {
            'schema': {
                'timestamp': 'string',
                'host': 'string',
                'application': 'string',
                'message': 'string'
            },
            'configuration': {
                'envelope_keys': {
                    'env_key_01': 'string',
                    'env_key_02': 'string'
                },
                'optional_envelope_keys': [
                    'env_key_01'
                ],
                'optional_top_level_keys': [
                    'host'
                ]
            }
        }

        parser = ParserBase(options)
        assert_equal(parser._validate_schema(), True)
예제 #2
0
    def test_validate_schema_invalid(self):
        """ParserBase - Validate Schema, Invalid"""
        options = {
            'schema': {
                'timestamp': 'string',
                'host': 'string',
                'application': 'string',
                'message': 'string'
            },
            'configuration': {
                'optional_top_level_keys': [
                    'date'
                ]
            }
        }

        parser = ParserBase(options)
        assert_equal(parser._validate_schema(), False)