Example #1
0
    def test_parse_log_errors(self):

        line = 'unformatted'

        with pytest.raises(Exception):
            utils.parse_log(log_line)
Example #2
0
    def test_parse_log_value(self, log_line):

        parsed = utils.parse_log(log_line)

        assert parsed['value'] == 'VALUE'
Example #3
0
    def test_parse_log_key(self, log_line):

        parsed = utils.parse_log(log_line)

        assert parsed['key'] == 'KEY'
Example #4
0
    def test_parse_log_message(self, log_line):

        parsed = utils.parse_log(log_line)

        assert parsed['message'] == 'KEY=VALUE'
Example #5
0
    def test_parse_log_type(self, log_line):

        parsed = utils.parse_log(log_line)

        assert parsed['type'] == 'TYPE'
Example #6
0
    def test_parse_log_time(self, log_line):

        parsed = utils.parse_log(log_line)

        assert parsed['timestamp'] == 'TIME'