Esempio n. 1
0
    def test_extract_envelope_none(self):
        """ParserBase - Extract Envelope, None"""
        record = {'key': 'value'}

        parser = ParserBase(None)
        envelope = parser._extract_envelope(record)
        assert_equal(envelope, None)
Esempio n. 2
0
    def test_extract_envelope(self):
        """ParserBase - Extract Envelope"""
        options = {'configuration': {'envelope_keys': ['env_key_01']}}
        record = {'env_key_01': 'foo', 'non_env_key': 'bar'}

        parser = ParserBase(options)
        envelope = parser._extract_envelope(record)
        assert_equal(envelope, {'env_key_01': 'foo'})