コード例 #1
0
ファイル: test_filter.py プロジェクト: twaugh/journal-brief
 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
ファイル: test_filter.py プロジェクト: twaugh/journal-brief
 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
ファイル: test_filter.py プロジェクト: twaugh/journal-brief
 def test_priority(self):
     inclusion = Inclusion({'PRIORITY': 'err'})
     priority_type = journal.DEFAULT_CONVERTERS.get('PRIORITY', str)
     assert inclusion.matches({'PRIORITY': priority_type(3)})