Пример #1
0
 def test_and(self):
     inclusion = Inclusion({'MESSAGE': ['include this'],
                            'SYSLOG_IDENTIFIER': ['from this']})
     assert inclusion.matches({'MESSAGE': 'include this',
                               'SYSLOG_IDENTIFIER': 'from this',
                               'IGNORE': 'ignore this'})
     assert not inclusion.matches({'MESSAGE': 'include this'})
Пример #2
0
 def test_or(self):
     inclusion = Inclusion({'MESSAGE': ['include this', 'or this']})
     assert inclusion.matches({'MESSAGE': 'include this',
                               'IGNORE': 'ignore this'})
     assert not inclusion.matches({'MESSAGE': 'not this',
                                   'IGNORE': 'ignore this'})
Пример #3
0
 def test_priority(self):
     inclusion = Inclusion({'PRIORITY': 'err'})
     priority_type = journal.DEFAULT_CONVERTERS.get('PRIORITY', str)
     assert inclusion.matches({'PRIORITY': priority_type(3)})